I am getting the following error and can not figure out why:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/XXXXX/public_html/XXXXXXXXXX/newbie/editor/content/listContent.php on line 40
Can anyone see a reason why, or what it means?(I have outined line 40 with the
+++===+++
so you would know what line it is, it is not in my code.)
My code is below.
<?php
include_once("../common/dbConnection.php");
?>
<?
$initStartLimit = 0;
$limitPerPage = 10;
$startLimit = $_REQUEST['startLimit'];
$numberOfRows = $_REQUEST['rows'];
$sortBy = $_REQUEST['sortBy'];
$sortOrder = $_REQUEST['sortOrder'];
if ($startLimit=="")
{
$startLimit = $initStartLimit;
}
if ($numberOfRows=="")
{
$numberOfRows = $limitPerPage;
}
if ($sortOrder=="")
{
$sortOrder = "DESC";
}
if ($sortOrder == "DESC") { $newSortOrder = "ASC"; } else { $newSortOrder = "DESC"; }
$limitQuery = " LIMIT ".$startLimit.",".$numberOfRows;
$nextStartLimit = $startLimit + $limitPerPage;
$previousStartLimit = $startLimit - $limitPerPage;
if ($sortBy!="")
{
$orderByQuery = " ORDER BY ".$sortBy." ".$sortOrder;
}
$sql = "SELECT * FROM content".$orderByQuery.$limitQuery;
$result = MYSQL_QUERY($sql);
+++++++=================+++++++++
$numberOfRows = MYSQL_NUM_ROWS($result);
+++++++=================+++++++++
?>
<?
if ($numberOfRows==0) {
?>
Sorry. No records found !!
<?
}
else if ($numberOfRows>0) {
$i=0;
?>