jj20051 Posted August 13, 2008 Share Posted August 13, 2008 Ok. I Started Making A Very Small Search Script For My Website. I Made the Following Code Below. Later I Decided I Wanted To Add A Feature Where If There Were No Results It Would Say "No Content Matches Your Search." For Some Reason No Matter What I Try It Does Not Work. I Am Listing The Original Code So No One Get's Confused. <? include "config.php"; if (@$_POST['search']=="search") { $keyword=$_POST['keyword']; $result=mysql_query("SELECT * FROM websites WHERE `title` LIKE '%$keyword%' OR `url` LIKE '%$keyword%' OR `description` LIKE '%$keyword%' "); while ($results = mysql_fetch_array($result)) { $title=$results['title']; $url=$results['url']; $description=$results['description']; echo "<a href='$url'>$title</a><br><i>$description</i><br><font color=\"#339900\">$url</font><br><br>"; } } Link to comment https://forums.phpfreaks.com/topic/119412-solved-no-data/ Share on other sites More sharing options...
trq Posted August 13, 2008 Share Posted August 13, 2008 Define 'does not work'. This script will only ever find result matching the word search and nowhere do you attempt to display a "No Content Matches Your Search." message. And whats with the caps? Link to comment https://forums.phpfreaks.com/topic/119412-solved-no-data/#findComment-615165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.