On May 26, 2004, at 11:17 PM, Albert Padley wrote:


On May 26, 2004, at 11:16 PM, Curt Zirzow wrote:

* Thus wrote Albert Padley ([EMAIL PROTECTED]):

<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

John, Tom and Curt,

I found that I had an include of functions that was somehow mucking things up. When I removed the functions page, all 3 of your solutions worked.

Thank you all for taking the time to assist.

Albert Padley

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to