Number of Rows Selected or Affected in MySQL

Q

How To Get the Number of Rows Selected or Affected by a SQL Statement in MySQL?

✍: FYIcenter.com

A

There are two functions you can use the get the number of rows selected or affected by a SQL statement:

  • mysql_num_rows($res) - Returns the number of rows selected in a result set object returned from SELECT statement.
  • mysql_affected_rows() - Returns the number of rows affected by the last INSERT, UPDATE or DELETE statement.

 

⇒ Inserting Data into an Existing Table in MySQL

⇐ Creating a New Table in MySQL

⇑ Managing Tables and Running Queries with PHP for MySQL

⇑⇑ MySQL Database Tutorials

2017-10-08, 3070🔥, 0💬