paulman888888 Posted December 2, 2008 Share Posted December 2, 2008 Simple Question; What have i done wrong again? Its my little search engine page. Have more than one table the user can search. I have limited the tables the user can see so theres no sercurity problem. Heres the code // Build SQL Query $query = "SELECT * FROM `$search_where` WHERE '$search_name' LIKE \"%$trimmed%\" ORDER BY id"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults);//this is line 62 Heres the error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/paul/public_html/page/search.php on line 62 EDIT: I have just done another try and i got no errors but i also got no search results. I no theres is some but why am i not getting any? Thankyou all in advance Paul Link to comment https://forums.phpfreaks.com/topic/135181-little-problem-mysql-and-php-problem-please-help/ Share on other sites More sharing options...
unkwntech Posted December 2, 2008 Share Posted December 2, 2008 It meas that line 61 ($numresults=mysql_query($query) is does not contain a valid query. Did you connect to the DB server and select a BD Side Note: There is still a potentail security problem there. change LIKE \"%$trimmed%\" ORD to LIKE \"%" . mysql_real_escape_string($trimmed) . "%\" ORD Link to comment https://forums.phpfreaks.com/topic/135181-little-problem-mysql-and-php-problem-please-help/#findComment-704048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.