View Single Post
Old 03-06-2003, 04:58 PM   #1 (permalink)
bdl
Senior Contributor
 
Join Date: May 2002
Location: vta.ca.usa
Posts: 555
bdl is on a distinguished road
Trying to count an array

I'm trying to count an array with the values output from mysql_affected_rows. The rows are deleted properly, but it returns '1' no matter how many rows are selected and deleted. Ideas?

PHP Code:
foreach ($del_row as $row_id) {
             
$result mysql_query("DELETE FROM $db_table WHERE id = $row_id");
        }
        
$deleted_rows = array(mysql_affected_rows());
        
$num_rows count($deleted_rows);
        echo 
$num_rows " deleted.\n<br><br>\n"
bdl is offline   Reply With Quote