1 2
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=2
3
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=3
4
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=4
5
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=5
6
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=6
7
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=7
8
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=8
[Next]
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=2
[Last Page]
index.php?page=categ&menu=categ&category=Battery Operated Toys&pagenum=8
Limiting results to first 20 results, then next 20, then...
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Limiting results to first 20 results, then next 20, then...
Like so?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Limiting results to first 20 results, then next 20, then...
No, but that was still very useful. Assuming the script is 'sane', the problem lies with the reported amount of pages it should print, and not with the actual printing (since the system looks like it should for a 8-page system).
Read the second half of my previous post. Hopefully there's a problem with $maxPage.
Read the second half of my previous post. Hopefully there's a problem with $maxPage.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Limiting results to first 20 results, then next 20, then...
I rendered the results of numrows and rowsPerPage and this was the result:
Num of Rows: 149
Rows per page: 20
It's wrong though, and it knows it as it only produces about 49 results... not results from 149 rows..??
HOLD ON... i've cracked it....durrr..
This was the error:
It now works perfectly. Just a little CSSing to do on it.
Thank you.
Num of Rows: 149
Rows per page: 20
It's wrong though, and it knows it as it only produces about 49 results... not results from 149 rows..??
HOLD ON... i've cracked it....durrr..
This was the error:
... on line 79 it didn't do the check on the 'category' field in the table. so it was always producing the numrows for EVERYTHING in the table. Can't believe I didn't spot that, but that's when I just checked the calculations.$query = "SELECT COUNT(id) AS numrows FROM products WHERE category = '$mycateg' AND stockstatus= 'in stock'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result, MYSQL_ASSOC);
It now works perfectly. Just a little CSSing to do on it.
Thank you.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
Re: Limiting results to first 20 results, then next 20, then...
I take it that the pages are error-free now. I'm glad you managed to spot the last step by yourself. Anyone who has the brain to troubleshoot, has the brain to make the troubles in the first place. 
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Limiting results to first 20 results, then next 20, then...
[laughs].... very good comment and very true!
It's completely trouble free, so thanks for the 70+ efforts!!!!
It's completely trouble free, so thanks for the 70+ efforts!!!!
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.