Re: Multiple deletes and updates...

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

 



You can use checkboxes to do it :

<input type="checkbox" name="delrec[]" value="<?=$recid?>">

and in the code

foreach($_POST["delrec"] as $ccc) {

   $res=mysql_query("delete from  table_name  where id= $ccc");
}

HTH

Mustafa


----- Original Message ----- 
From: <Tristan.Pretty@xxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
Sent: Thursday, March 04, 2004 3:36 PM
Subject:  Multiple deletes and updates...


> I simply can't get my head round this today....
> Probably easy, but I've been chocka, and brain is melting...
> Anyhoo...
>
> If I have a table, with say, id(unique, auto inc), name, email,
> membership_type
>
> I've listed them on a PHP page...
> I want to add a checkbox to each row, so that I can select 1 or all, and
> then perform an action on ALL selected (Either Delete, or change
> membership_type)
> I can do this with ease one by one, but I cant get my head round to more
> than one with one submit button...?
>
> Can anyone nudge me in the right direction....?
> I've seen this on the list before, but couldn't find it in the archive (I
> may have imagined it?)
>
> cheers,
> Tris...
>
>
> *********************************************************************
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***********************************************************************
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux