How to Determine the Success of a MySQL DELETE Operation
When executing a DELETE statement in MySQL using PHP, determining its success can prove beneficial.
Using MySQL Query Functions
To ascertain the outcome of a DELETE operation using mysql_query, the function returns:
Alternatively, when employing PDO::exec, the function returns:
mysql_affected_rows Function
To verify the impact of a DELETE operation more precisely, consider using the mysql_affected_rows function. This function returns:
The above is the detailed content of How to Check if a MySQL DELETE Operation Was Successful?. For more information, please follow other related articles on the PHP Chinese website!