Re: build an array of checkbox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Tomás,

Friday, March 18, 2005, 1:31:40 PM, you wrote:
T> I have a doubt, I want to build an array of checkbox, why? well
T> because I list a recordset from data base, and I want to delete the
T> current record when the check is selected by the click mouse. for
T> example the editor of mail.yahoo.xx, that you can delete any mail
T> when you selected any checkbox.

<input type="checkbox" name="delete[]" value="<?php echo $r['id']; ?>" />


delete becomes your array
  i.e. print_r($_POST['delete']);

$r['id'] is the record id from the DB.

Then do a foreach through the delete array and delete out records
where id = the "as" variable used in the foreach.


-- 
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.0.9.7 Return (pre-beta) under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux