Dysan Posted December 26, 2007 Share Posted December 26, 2007 How do I create a search engine, that allows the user to search 3 different fields contained in the database, with a specified criteria? Link to comment https://forums.phpfreaks.com/topic/83287-simple-search-engine/ Share on other sites More sharing options...
Northern Flame Posted December 26, 2007 Share Posted December 26, 2007 I wrote this tutorial myself http://forums.tizag.com/showthread.php?t=5015 Link to comment https://forums.phpfreaks.com/topic/83287-simple-search-engine/#findComment-423761 Share on other sites More sharing options...
p2grace Posted December 26, 2007 Share Posted December 26, 2007 If you're looking for a more simple search engine try this: $query = "SELECT `field1`, `field2`, `field3` FROM `dbtable` WHERE `field1` LIKE '%$search_str%' OR `field2` LIKE '%search_str%' OR `field3` LIKE '%search_str%'"; $run = mysql_query($query); while($arr = mysql_fetch_assoc($run)){ extract($arr); echo "$field1 $field2 $field3<br />"; } This is obviously much more basic. But if you're just trying to create a simple search engine it would do the trick Link to comment https://forums.phpfreaks.com/topic/83287-simple-search-engine/#findComment-423768 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.