FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » delete multiple records code
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
delete multiple records code [message #174438] Sat, 11 June 2011 18:10 Go to previous message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma:
Member
Hi All,

I have some code which should delete some records.
It is a bulletin board page with posts. I want to delete the posts of
which the checkbox has been checked.

echo '<form name="form" id="form" method="post">';
if (isset($_SESSION['idx'])) {
if($account_type == 'c') {
$outputList .= '<td width="10%" ><div class="name"
align="left"><input type="checkbox" name="delete" value="' . $id . '" /
> </div></td>';
}
}

echo '</form>';

if (isset($_POST['bb_index']) && !empty($_POST['form'])) {
foreach($_POST['form'] as $id) {
// This is a loop with the var $id containing
// all items that were checked to be deleted
print 'Delete this $id';

}
}


if (isset($_SESSION['idx'])) {
if($account_type == 'c') {
echo '<a href="bb_index.php?post=delete"><img src="images/
Delete.png" border="0" width="30" height="30" /></a>';
}} ?>

My code doesn't print any records even when some are checked.

Marco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: haiii
Next Topic: S Is For Scandal Is For Sokolich
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 07:33:22 GMT 2024

Total time taken to generate the page: 0.05138 seconds