Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 2nd, 2006, 03:05 AM
Registered User
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete records in MySQL using checkboxes in forms

Hai guys,

I have the following doubt
How can we delete a set of records that is in a database using checkboxes.

I have created a database and I have also created a checkbox beside the row to be displayed.

Can anyonw help

Old August 8th, 2006, 07:46 AM
Friend of Wrox
Join Date: Nov 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts


First you will need to know how to delete records with use of SQL only. I'm guessing you allready achieved this.

Regarding the check boxes you can generate checkboxes with php linked to the id in the database. When you post your form then you can delete the records where the id's match.

In your form you submit the form with checkboxes the id's 3,5,7
On the process page you make the the querry look like the following

DELETE FROM tbl_name
WHERE id=3
AND id=5
AND id=7

How you build this querry using PHP is up to you that's the challange

__________________________________________________ ________
This is my junk I'm gona eat it
Old August 10th, 2006, 05:01 AM
Registered User
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Thanks for the reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
php/mysql delete button and delete query dungey PHP Databases 17 April 11th, 2009 12:24 PM
delete using checkboxes in gridview aspvbnet ASP.NET 2.0 Basics 1 November 22nd, 2006 08:28 PM
The use of checkboxes to delete records inoracle9i luisbueno Classic ASP Databases 0 December 24th, 2004 12:07 PM
Cannot get multiple delete using checkboxes workin gmizzell Classic ASP Databases 0 July 13th, 2003 04:22 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.