I construct the query with a loop, and I've been echoing it to inspect it before it gets passed to the mysql_query() function.
Here is the string, maybe one of you can tell me why this query doesn't work ... ?
Code: Select all
SELECT * FROM books WHERE keywords LIKE %safety% OR keywords LIKE %marine% OR keywords LIKE %usmc% OR keywords LIKE %naval safety center% OR keywords LIKE %leader%$num=mysql_numrows($result);
The error i get is this: Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource