What does the function mysql_affected_rows() return in PHP?
The function mysql_affected_rows() in PHP returns the number of rows affected by the last INSERT, UPDATE, or DELETE query executed. This function can be used to determine the impact of a query on the database.
// Assuming a successful MySQL query has been executed
$affected_rows = mysql_affected_rows($connection);
echo "Number of rows affected: " . $affected_rows;
Keywords
Related Questions
- How can fgetcsv function be utilized to improve reading specific columns from a text file in PHP?
- What is the recommended approach for displaying error messages in the same page after form submission in PHP?
- How can PHP files in a specific directory be prevented from being executed by the Apache interpreter?