#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    TX
    Posts
    38
    Rep Power
    14
    Me again :-).
    Can someone tell me or point me in the direction (url reference) of how to create a html form that a user fills out to search my MySql database..either by first name or id number or something? And can add to the database too within the same form??

    Thanks in advance!

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Minneapolis, MN
    Posts
    48
    Rep Power
    15
    Code from Page with TextBox for search terms:

    <form method="post" action="SearchPage.php3">
    Search Postings:
    <input type="Text" name="Search" size="20" maxlength="30">
    <input type="Submit" name="submit" value="Search">
    </form>


    Code from page that Actually does the search (SearchPage.php3)

    <MySQL connect stuff to your database>

    $result = mysql("$DBTouse","SELECT * FROM $Table WHERE (ISBN LIKE '%$Search%' OR Title LIKE '%$Search%' OR Author LIKE '%$Search%') AND (TO_DAYS(Expires) >= TO_DAYS(Current_Date)) ORDER BY Course,Price");


    This is what I use for users to Search the Booksale Classifieds on my site.

    hope that helps,
    Dave
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    TX
    Posts
    38
    Rep Power
    14
    Thanks Dave!

    However, I am using Perl, not PHP. Any ideas with Perl?

  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    CA USA
    Posts
    2
    Rep Power
    0
    Are you using Perl and DBI? Just use the same SQL statement inside DBI.


    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by explore:
    Thanks Dave!

    However, I am using Perl, not PHP. Any ideas with Perl?
    [/quote]

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    TX
    Posts
    38
    Rep Power
    14
    Cool! I got it to search my database and display the results. I still need to be able to "add comments" once I retrieved that particular data in the database..

    ie did a query on explore
    received explore's address information
    need to make changes to the street address

    Thanks!

Similar Threads

  1. Replies: 3
    Last Post: February 11th, 2004, 08:30 AM
  2. Replies: 5
    Last Post: December 24th, 2003, 07:59 AM
  3. Update MYSQL from dynamicly generated form?
    By direwolf in forum PHP Development
    Replies: 2
    Last Post: August 13th, 2002, 12:05 AM
  4. Replies: 21
    Last Post: January 26th, 2002, 04:21 PM
  5. Searching a MySQL Database
    By dynamic1 in forum PHP Development
    Replies: 2
    Last Post: February 23rd, 2000, 04:45 AM

IMN logo majestic logo threadwatch logo seochat tools logo