×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to get the number of affected rows in previous MySQL operation?


PHP - How to get the number of affected rows in previous MySQL operation?

You have to use the mysql_affected_rows() function, for example on delete command, in order to get the numbe rof the delted rows you need to do the following:

<?php
...
 mysql_query("DELETE FROM mytable WHERE ID > 1000 ");
 echo "Records deleted: ". mysql_affected_rows();
...
?>

Category: PHP

 
<< Go back