I'm trying to add Pagination to a php/mysql page that pulls a list of cars from a database. This works fine, but trying to implement Pagination has thrown a couple of errors at me i can't seem to fix.
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 'LIMIT (1-1)*20, .20' at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/uplift/public_html/index.php on line 86
I think it will be much easier here to just paste the whole page:
The first error refers to this line:
$limit = "LIMIT ($pageno-1)*$perPage, .$perPage";
second error refers to this line:
while($row = mysql_fetch_array($result)) {
Can anyone spot the errors? also, is there not an easier way to do this, it seems really complicated.
Question
game_over
I'm trying to add Pagination to a php/mysql page that pulls a list of cars from a database. This works fine, but trying to implement Pagination has thrown a couple of errors at me i can't seem to fix.
I think it will be much easier here to just paste the whole page:
The first error refers to this line:
$limit = "LIMIT ($pageno-1)*$perPage, .$perPage";
second error refers to this line:
while($row = mysql_fetch_array($result)) {
Can anyone spot the errors? also, is there not an easier way to do this, it seems really complicated.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts