Difference in between mysql_num_rows and mysql_affected_rows

Mar 12, 2012   //   by phpfreelancer.biz   //   Blog, MySQL Tutorial  //  No Comments

I want to know what is the difference in between mysql_num_rows and mysql_affected_rows

Use mysql_num_rows for SELECT queries while mysql_affected_rows for UPDATE and DELETE queries.

mysql_num_rows tells you how many records were returned from a SELECT query

mysql_affected_rows tells you how many rows were UPDATE or DELETE

Leave a comment

Share This Post

RSS Wordpress News