|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Thanks Dave!
However, I am using Perl, not PHP. Any ideas with Perl? |
|
#4
|
|||
|
|||
|
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] |
|
#5
|
|||
|
|||
|
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! |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Searching MySql Database via web form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|