How can I get row count values in MySQL as @@ROWCOUNT does in mssql?
How can I get row count values in MySQL as @@ROWCOUNT does in mssql?
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.
For SELECTs you can use the
FOUND_ROWSconstruct (documented here):which will return the number of rows in the last
SELECTquery (or if the first query has aLIMITclause, it returns the number of rows there would’ve been without theLIMIT).For
UPDATE/DELETE/INSERT, it’s the ROW_COUNT constructwhich will return the number of affected rows.