I wasn’t sure if it recounted the rows, or if after it retrieved the whole result set, it only grabbed the total post query?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
when you run a statement, mysql sends the row count in the header. so no, the query is not re-run to get the count.
this has an interesting implication for queries with LIMIT. mysql_num_rows() returns the number of rows returned after LIMIT is applied. if you use the SQL_CALC_FOUND_ROWS keyword in your SELECT statement, then mysql_num_rows() returns the number of rows that would have been returned if LIMIT were not used. this is helpful for paging.