You may just be displaying the variable holding the return value from a query which is a result resource ID. These should not be displayed. You need to use the variable holding the return value from a fetch to display table data.
On the other hand, if it's this type of warning, then read on:
Warning:mysql_result/mysql_fetch_assoc/mysql_fetch_array/mysql_num_rows/mysql_fetch_objet
supplied argument is not a valid MySQL result resource in …
Drakla is correct ("you tried feeding the result of a bad query into a fetch..").
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 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). See this post for examples of MySQL error checking. You must check for errors 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.