Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in _____________________________________________________
I have seen a lot of this around the internet lately, both in forums and on some production websites (WHOOPS!) :cheesy: I am currently developing a small site which uses MySQL as it's data repository, and I am encountering this error at random. It seems to me like it occures mostly when something was mispelled in an sql query or when a variable has a type-mismatch.
In any event, I think the reason why this is happening is because I am using a wrapper class for the my_sql resources. This just makes things easier to manage if you ask me, however, the lines of code that Zend is pointing to are:
$this->result = mysql_query($sql);
$this->numberofRows = mysql_num_rows($this->result);
I think that it may be because it doesn't recognize $this->result as a valid resource, since $result seems to work.
Does anyone know one SURE way to resolve this issue, or is it different all the time?