kathierry2106 Posted February 27, 2008 Share Posted February 27, 2008 hello to all! I'm looking for php script codes of search that will search into to Retrieve all the records that match to the the search string am entering in the form of search mysql database "library_bank" with 3 tables : book, journal, cd *** <html> <head><title>Searching the Database_library</title> </head> <body bgcolor=#ffffff> <CENTER><h2>Searching the Database Library</h2> </CENTER> <form method="post" action="check_database.php3"> <table width=90% align=center> <tr><td>search for BOOK, JOURNAL, CD-ROM,...:</td> <td><input type=text name='search' size=60 maxlength=255></td></tr> <td></td> <td><input type=submit VALUE='SEARCH'></td></tr> </table> </form> </body> </html> ***** any help will be highly appreciated Thanks in advance best reagards Thierry Link to comment https://forums.phpfreaks.com/topic/93298-search-into-mysql-database/ Share on other sites More sharing options...
DarkerAngel Posted February 27, 2008 Share Posted February 27, 2008 hello to all! I'm looking for php script codes of search that will search into to Retrieve all the records that match to the the search string am entering in the form of search mysql database "library_bank" with 3 tables : book, journal, cd *** <html> <head><title>Searching the Database_library</title> </head> <body bgcolor=#ffffff> <CENTER><h2>Searching the Database Library</h2> </CENTER> <form method="post" action="check_database.php3"> <table width=90% align=center> <tr><td>search for BOOK, JOURNAL, CD-ROM,...:</td> <td><input type=text name='search' size=60 maxlength=255></td></tr> <td></td> <td><input type=submit VALUE='SEARCH'></td></tr> </table> </form> </body> </html> ***** any help will be highly appreciated Thanks in advance best reagards Thierry Are you looking to have it return specific results, like this book exists or use a 'fuzzy' search where if something is close it will still return it. Link to comment https://forums.phpfreaks.com/topic/93298-search-into-mysql-database/#findComment-477867 Share on other sites More sharing options...
xtrafile Posted February 27, 2008 Share Posted February 27, 2008 I'd recommend just use a WHERE statement either way so it finds the result in context... would be much easier. Link to comment https://forums.phpfreaks.com/topic/93298-search-into-mysql-database/#findComment-477977 Share on other sites More sharing options...
kathierry2106 Posted February 27, 2008 Author Share Posted February 27, 2008 help plz on this script tks Link to comment https://forums.phpfreaks.com/topic/93298-search-into-mysql-database/#findComment-478008 Share on other sites More sharing options...
DarkerAngel Posted February 27, 2008 Share Posted February 27, 2008 help please on this script tks If you want us to help you should properly answer the questions we ask so we can provide you with the proper help. Link to comment https://forums.phpfreaks.com/topic/93298-search-into-mysql-database/#findComment-478022 Share on other sites More sharing options...
cyrixware Posted February 27, 2008 Share Posted February 27, 2008 Simple search query. Example <input name="searchTerm" type="text"> <input type="submit" name="Submit" value="Search"> <?php if($_REQUEST['Submit'] == "Search") { $searchTerm = $_REQUEST['searchTerm']; include("../connDB.php"); $sql_search_subject = "SELECT * FROM subject WHERE SCode = '$searchTerm' "; if( $searchTerm == ''){ }elseif(!$q_search_subject = mysql_query($sql_search_subject)) { echo "<font color=white></font>"; } elseif(!mysql_num_rows($q_search_subject)) { echo "<center>Search Results... No record found!</center>"; } else { while($r_search_subject = mysql_fetch_assoc($q_search_subject)) { $SCode=$r_search_subject['SCode']; echo"$SCode"; $SDesc=$r_search_subject['SDesc']; echo"$SDesc"; } } } ?> Link to comment https://forums.phpfreaks.com/topic/93298-search-into-mysql-database/#findComment-478038 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.