How do i do a multiple record update

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iceangel89
Forum Commoner
Posts: 39
Joined: Mon Jul 02, 2007 7:02 pm

How do i do a multiple record update

Post by iceangel89 »

how can i implement something like in gmail where i can select multiple records and delete them for example? or update all with a specific field value eg. update all selected records' "STATUS" to "Closed"
Attachments
gmail.png
gmail.png (18.84 KiB) Viewed 98 times
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: How do i do a multiple record update

Post by Benjamin »

Code: Select all

 
<?php
if (count($_POST) > 0)
{
    echo '<pre>' . print_r($_POST, true) . '</pre>';
}
?>
<form method="post" name="foo" action="#">
 
<input type="checkbox" name="email_ids[]" value="1" />
<input type="checkbox" name="email_ids[]" value="2" />
<input type="checkbox" name="email_ids[]" value="3" />
<input type="checkbox" name="email_ids[]" value="4" />
<input type="checkbox" name="email_ids[]" value="5" />
<input type="checkbox" name="email_ids[]" value="6" />
 
<input type="submit" value="submit" />
 
</form>
 
Post Reply