Which function gives us the number of affected entries by a query?

  • The mysqli_affected_rows() function
  • The mysqli_num_rows() function
  • The mysqli_query_count() function
  • The mysqli_result_count() function
The mysqli_affected_rows() function is used to retrieve the number of affected rows by a query in PHP. It returns the number of rows affected by the last INSERT, UPDATE, DELETE, or REPLACE statement executed with the MySQLi connection. It's important to note that this function only works with the MySQLi extension in PHP. If you are using the deprecated MySQL extension or the PDO extension, you need to use the respective functions provided by those extensions to retrieve the number of affected rows.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *