Hi Guys,
Say I want to know how many items match a select statement like this...
SELECT * FROM products WHERE product_name="bag"
Now say there are 10,000 results found, but I only care to see 100 at a time, yet I want to know how many total were found so I can generate page 1 | 2 | 3 links.
LIMIT 100 will only pull 100 at a time, but it won't tell me how many in total were found.
And the above statement will pull all, but will take up a bit of memory and 99% of the stuff will be useless.
I also know I can do 2 seperate calls, but that seems inefficient, so is there a single call I can use to pull 100 results at a time from product_id X to product_id Y and at the same time know how many results total without reading all of the unnecessary data?
Thanks!
Luc L.
Say I want to know how many items match a select statement like this...
SELECT * FROM products WHERE product_name="bag"
Now say there are 10,000 results found, but I only care to see 100 at a time, yet I want to know how many total were found so I can generate page 1 | 2 | 3 links.
LIMIT 100 will only pull 100 at a time, but it won't tell me how many in total were found.
And the above statement will pull all, but will take up a bit of memory and 99% of the stuff will be useless.
I also know I can do 2 seperate calls, but that seems inefficient, so is there a single call I can use to pull 100 results at a time from product_id X to product_id Y and at the same time know how many results total without reading all of the unnecessary data?
Thanks!
Luc L.