V Posted June 16, 2010 Share Posted June 16, 2010 So far, pagination has been the most challenging. I have been working 2 days on a script and still get errors. I'm following this tutorial http://net.tutsplus.com/tutorials/php/how-to-paginate-data-with-php/ also available on http://www.catchmyfame.com/2007/07/28/finally-the-simple-pagination-class/ with more explanation. I'm trying to implement the code in my comments. The entire code I'm using now is here http://www.phpriot.com/2918 the errors I get are Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\sitetest\comments.php on line 97 Notice: Undefined index: ipp in C:\wamp\www\gisttest\paginator.class.php on line 25 Notice: Undefined index: page in C:\wamp\www\gisttest\paginator.class.php on line 35 Notice: Undefined index: ipp in C:\wamp\www\gisttest\paginator.class.php on line 100 Notice: Undefined index: ipp in C:\wamp\www\gisttest\paginator.class.php on line 101 All Database query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-25,25′ at line 1 I realize this is a complex code (or so to me) but at least a little guidance would be greatly appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/204976-pagination-forget-about-it/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 16, 2010 Share Posted June 16, 2010 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\sitetest\comments.php on line 97 ^^^ your query failed due to an error of some kind and returned a FALSE value. You need to troubleshoot why your query is failing and your code has no error checking logic in it to test if the query worked before blindly attempting to use the results from the query (mysql_num_rows() in this case.) Quote Link to comment https://forums.phpfreaks.com/topic/204976-pagination-forget-about-it/#findComment-1073109 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.