Hi all,
I have a small question. Is it possible to return the total number of records in a database whilst using LIMIT at the same time?
I'm using a simple SELECT statement with a LIMIT, but would also like to grab the total number of records in the database. E.G
SELECT * FROM mytable LIMIT 0, 20
I dont want to run another select without LIMIT just to grab the rowcount, but mysql_num_rows() only returns the LIMITed value (e.g. 20 in this case).
I ask this, because I'd like to display something similar to "Page 1 of 10, Record 1 to 20" on my page, and I cant calculate the limt without the total record count.
If anyone has an answer or a suggestion, I would appreciate it.
Cheers,
Ben Davies
P.S. I'm new to MySQL and PHP, having recently (I.E. this week) moved from a Windows box with Win2k and Access (urgh!) driven websites, so please be gentle with me in your reply! Us ex-MS boys arent too technical!