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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.