I'm using a basic form, to search a databased which other users have submitted their site url, and description along with keywords.
The script searchs fine, and displays the 'description' found in the database, the url, or title doesn't print out. Here's my code:
<?php
mysql_connect (localhost, username, password);
mysql_select_db (database-name);
if ($title == "")
{$title = '%';}
if ($url == "")
{$url = '%';}
if ($words == "")
{$words = '%';}
if ($des == "")
{$des = '%';}
$result = mysql_query ("SELECT * FROM search
WHERE words LIKE '$words%'
");
if ($row = mysql_fetch_array($result)) {
do {
print ("<table border=0 cellpadding=0 cellspacing=0>");
print ("<tr>");
print ("<td align=left valign=middle>");
print ("<font size=2><b>");
print ("<a href=$url>$title</a></b> : ");
print ("</td>");
print ("<td align=center valign=middle>");
print $row["des_"];
print ("</tr></td></table>");
print ("<p>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";}
?>
Search Form:
<form action=searchform.php method=GET>
Search For:
<p>
Keywords<input type=text name="_words" size=25 maxlength=25>
<p>
<input type=submit>