Hello all.
I have a website which is giving me the following error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home2/pwoconte/public_html/classes/db.inc.php on line 54
MySQL Error Occured
The code for the file in question is below. Line 54 has been bolded:
function select($query, $maxRows=0, $pageNum=0)
{
$this->query = $query;
// start limit if $maxRows is greater than 0
if($maxRows>0)
{
$startRow = $pageNum * $maxRows;
$query = sprintf("%s LIMIT %d, %d", $query, $startRow, $maxRows);
}
$result = mysql_query($query, $this->db);
[b]$count = mysql_num_rows($result);[/b]
if ($this->error()) die($this->debug());
$output=false;
if( $count != 0){
for ($n=0; $n < $count; $n++)
{
The page was displaying fine for the last 4 weeks, and unfortunately, programming is not my thing. It is a photography contest site. The page is programmed not to show any results until a user has entered 10 contests. We have only had 5 contests so far, so I’m not sure what has caused the problem.
Any help you can provide would be greatly appreciated.