How I group by, with page numbering ?
Posted: Wed Sep 21, 2016 4:38 am
This is difficult to describe in a Subject.
We want to have a list of all products that are a specific type of product. Trouble is there are hundreds of them.
So we have them grouped into Categories and then Sub Categories. But means a very long slow-to-load page.
So I thought I would put them into page of 2 categories per page.
I've worked out the page number, but it's the actual page number links in the footer that don't work.
$query = "SELECT COUNT(catid) AS numrows FROM products WHERE top = 'yes' GROUP BY catid";
This is generating 66 pages. and it should only be about 5 or 6 pages.
If I run this in phpmyadmin, I see 9 rows, but each row has a few hundreds items in them.
So it maybe one of those queries in a query to make it work.
We want to have a list of all products that are a specific type of product. Trouble is there are hundreds of them.
So we have them grouped into Categories and then Sub Categories. But means a very long slow-to-load page.
So I thought I would put them into page of 2 categories per page.
I've worked out the page number, but it's the actual page number links in the footer that don't work.
$query = "SELECT COUNT(catid) AS numrows FROM products WHERE top = 'yes' GROUP BY catid";
This is generating 66 pages. and it should only be about 5 or 6 pages.
If I run this in phpmyadmin, I see 9 rows, but each row has a few hundreds items in them.
So it maybe one of those queries in a query to make it work.