Stotty Posted December 26, 2008 Share Posted December 26, 2008 Right im quite new to PHP and im making a new website and i need a little tool on it Like this http://www.zybez.net/items.php But not as High complex as that All i need is a blank form like this on homepage Saying Search : Form Here then under that in a table displays 3 random items from the database then when u search it searches by letter Like say i had one Called PHP Freaks i could type P to get to it not the Hole word like PHP Freaks im willing to give donations ( when my site starts getting ) to whoever can make it full credit Thank you in advanced Link to comment https://forums.phpfreaks.com/topic/138462-item-searching/ Share on other sites More sharing options...
Stotty Posted December 26, 2008 Author Share Posted December 26, 2008 Also if someone is going to make it is it possible to add The Images ? Link to comment https://forums.phpfreaks.com/topic/138462-item-searching/#findComment-723938 Share on other sites More sharing options...
Stotty Posted December 30, 2008 Author Share Posted December 30, 2008 Anyone ? Link to comment https://forums.phpfreaks.com/topic/138462-item-searching/#findComment-726128 Share on other sites More sharing options...
daalouw Posted December 30, 2008 Share Posted December 30, 2008 Stotty You will need wildcard matching. Assuming you're searching for an organization name in a database... <?php $search = htmlspecialchars($_GET['searchfield']); if (!get_magic_quotes_gpc()) { $search = addslashes($search); } $words = explode(" ", $search); $phrase = implode("%' AND organization LIKE '%", $words); $query = "SELECT organization, contactname, contacttitle from organization where organization like '%$phrase%'"; $result = mysql_query($query) or die('Could not query database at this time'); ?> Deon Link to comment https://forums.phpfreaks.com/topic/138462-item-searching/#findComment-726150 Share on other sites More sharing options...
daalouw Posted December 30, 2008 Share Posted December 30, 2008 By the way, my above example search for more than 1 field. Link to comment https://forums.phpfreaks.com/topic/138462-item-searching/#findComment-726186 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.