Re: Displaying the table records along with check boxes.
| From: | 1LT John W. Holmes | Date: | Wed, 03 Jul 2002 12:25:48 +0000 |
| Subject: | Re: Displaying the table records along with check boxes. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-105151@lists.php.net to get a copy of this message | ||
The code to create a check box is:
<input type="checkbox" name="whatever" value="something">
HTH,
---John Holmes...
PS: It might help if you actually try to do something yourself and then ask
a question. We're not here to feed you code. Anyways, a way you might
approach it is to name all of your checkboxes the same, something like
<input type="checkbox" name="delete[]" value="$id">
Where $id is a unique identifier for the row/field/etc... Then, you simply
use some code like this to delete all of the rows where the box was checked.
<?
$delete_ids = implode(",",$_REQUEST['delete']);
$result = mysql_query("DELETE FROM your_table WHERE id IN ($delete_ids)");
?>
HTHSM,
---John Holmes...
----- Original Message -----
From: "Balaji Ankem" <balaji.ankem@wipro.com>
To: <php-general@lists.php.net>
Sent: Wednesday, July 03, 2002 8:05 AM
Subject: [PHP] Displaying the table records along with check boxes.
> Hi friend,
> I would like to display the table records along with check boxes for
> the purpose of
> selecting particular records or select all and for deleteing them or
> for other purpose.
>
> Anybody have ready made code for this type...
>
> Any help would be greatly appreciated.
>
> Thanks and Regards
> Balaji
>
>
----------------------------------------------------------------------------
----
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php