I think that the following code looks fine, but I get an error (Warning: Supplied argument is not a valid MySQL result resource) where it says "while ($Row = mysql_fetch_array ($Result)) {" any ideas? <?php $Link = mysql_connect ($Host, $User, $Password); $title = trim($title); $title2 = ereg_replace (" ", " %' || like '% ", $title); if ($category) { $Query = "SELECT * from $TableName WHERE ((category)=$category)"; print "Your search query of <b> $category </b> returned the following results:<br><br>"; } else { if ($title) { $Query = "SELECT * from $TableName WHERE title LIKE '%$title2%' "; print "Your search query of <b> $title </b> returned the following results:<br><br>"; } } if ($category = "") { print ""; } $Result = mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)) { print "<a href=item.php?p=$Row[id]>"; echo ( $Row[title] ); print "</a><br>"; } mysql_close ($Link); ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]