I,m going through a tutorial for pagination using php mysql and ajax.
I'm getting this error
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\phpAjaxPagination\pageData.php on line 16
This is the file.
<?php
include_once('inc/dbConnect.inc.php');
include_once('inc/pagination.inc.php');
if(isset($_POST['pageId']) && !empty($_POST['pageId'])){
$id=$_POST['pageId'];
}else{
$id='0';
}
$pageLimit=PAGE_PER_NO*$id;
$query="SELECT post,link from pagination ORDER BY id DESC
LIMIY $pageLimit,".PAGE_PER_NO;
$res=mysql_query($query);
$count=mysql_num_rows($res);
$HTML='';
if($count > 0){
while($row=mysql_fetch_array($res)){
$post=$row['post'];
$link=$row['link'];
$HTML.='<div>';
$HTML.='<a href="'.$link.'" target="blank">'.$post.'</a>';
$HTML.='</div><br/>';
}
}else{
$HTML='No Data Found';
}
echo $HTML;
?>
Can anyone tell me the problem here?
Thanks...