shimh Posted March 19, 2009 Share Posted March 19, 2009 I use MySQL for logging. When I make an inquiry to the database via DAQFactory's db functions, I am wondering if it is a way to know the total number of returned records without going through all the records. It is useful when the records are too many to fit one page. If I know the total number of records to be shown, I can calculate and display how many pages are there. Thanks. Link to comment Share on other sites More sharing options...
AzeoTech Posted March 20, 2009 Share Posted March 20, 2009 Actually, getting the number of records from a SQL query is kind of a pain in general. You have to do Select Count(*) where condition That said, I'd use the db.querytoclass() function. Its not documented in the user's guide, but if you do a search on this forum you'll find all the details on using it in other posts. It returns the entire query in arrays, so you can just do numrows() on one of the arrays to get the number of records returned. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.