Regarding this type of messages:
Warning: mysql_result/mysql_fetch_assoc/mysql_fetch_array/mysql_num_rows/mysql_fetch_object: supplied argument is not a valid MySQL result resource in …
These messages are usually attributed to wrong SQL syntax in the query (or not connected to the database). What I mean by wrong syntax includes the possibility of using the wrong table or column names, and not just syntactically incorrect formatting of the query.
This message can be avoided altogether; it masks/hides the real error at the query (or prior issued MySQL command) and is a by-product of wrong logic. These messages occur because error checking wasn't performed after a query and a subsequent SQL command was issued to work on the query result (when there was already a query error).
You must check for errors after every MySQL command and when there are errors, don't execute any more SQL commands that retrieve data or require the use of the results table.
Handle the error after a query appropriately and your code logic shouldn't get as far as trying to read or examine the data inappropriately, then this warning message won't ever occur again.
You need to display the real error that caused the query to fail in order for you to solve the main problem (which is usually bad SQL query syntax). Not handling errors like this is a serious logic flaw in code and I see it all the time. A big part of coding is really error checking. Don't get lazy or forget to check for errors.
Of course this is assuming that you didn't accidentally pass the wrong variable name as the resource argument to mysql_data_seek(). Let's see the code.
🙂