There are a number of possible solutions (which are largely connected with the preceeding SQL statement rather than anything on the line the error number is for (mysql_num_rows() is commonly indicated if it is being used):
1. Make sure the tables and fields exist in your SQL statement.
2. If you are passing a variable in the SQL make sure it is probably escaped (usally in single quotes, but don't forget to addslash() if it came from outside (ie. get/post/cookie) and magic_quotes_gpc is off. Look those up in the php manual if you don't know what they mean).
Not doing this will generate the error:
code:
$sql = "SELECT something
FROM table
WHERE something = $variable";
and this will fix things:
code:
$sql = "SELECT something
FROM table
WHERE something = '$variable'";
Note: you could also use double quotes, but not within a double quoted string...