I don’t know this script, but the error is familiar to me. You have a bad SQL statment that you are sending to mysql_query(). When that fails it sends FALSE to mysql_num_rows(), which it can’t understand and says “not a valid MySQL result resource”.
Now what to do about it. Again I don’t know this script at all, but I would suggest that you use PHP-MySQL Admin and check the database schema, perhaps something is screwed up there, like missing tables/fields.