Just learning PHP & MYSQL and am getting an error message...
I'm typing an example right out of a textbook...I know my database 'books' is good but I'm curious if anyone sees the problem with this section of code.
$query = "select * from books where ".$searchtype."
like '%".$searchterm."%' ";
$result = mysql_query($query);
$num_results = mysql_num_rows($result); (this is line 31)
echo "<p>Number of books found: ".$num_results."</p>";
ERROR MESSAGE I get:
Warning: Supplied argument is not a valid MySQL result resource in /www/htdocs/results.php on line 31
Thanks to anyone who takes time to look this over!