Re: Delete Multiple Records From Checkboxes

From: Date: Thu, 27 May 2004 05:17:22 +0000
Subject: Re: Delete Multiple Records From Checkboxes
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-187035@lists.php.net to get a copy of this message
On May 26, 2004, at 11:16 PM, Curt Zirzow wrote:
* Thus wrote Albert Padley (apadley@apadley.com):
<input type=\"checkbox\" name=\"del[]\" value=\"" . $row['id'] . "\"> The processing code is: if (count($del) > 0){ for ($i=0;$i<count($del);$i++){ $query = "DELETE FROM ref_events_reg WHERE id = '$del[$i]'"; } }
I think you need to take a step back and figure out where the $del variable is comming from. Both solutions that have been provided should have worked if $del was really an array. Curt -- "I used to think I was indecisive, but now I'm not so sure." Curt,
I agree. I did a var_dump() with the following result: array(2) { ["del"]=> array(2) { [0]=> string(2) "15" [1]=> string(2) "16" } ["submit"]=> string(6) "Delete" } "15" and "16" are the correct id's for the records I'm trying to delete. However, when I echo $del[0] it returns "A" and when I echo $del[1] it returns "r" which happen to be the first 2 character in Array. So what gives? Albert Padley

« previous php.general (#187035) next »