Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 8th, 2007, 7:52 AM   #1
sanch3za
Newbie
 
Join Date: Dec 2007
Posts: 3
Rep Power: 0 sanch3za is on a distinguished road
delete data using checkbox

i have a problem about using checkbox in PHP.When I click DELETE, I want to delete data in the table and also the field of the database in mysql according to the checkbox was checked. I have simple printscreen about it.

[IMG]]http://img503.imageshack.us/img503/8950/checkboxzd3.th.jpg[/IMG]
sanch3za is offline   Reply With Quote
Old Dec 8th, 2007, 11:46 AM   #2
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: delete data using checkbox

And... so... what's the problem? If you've got this far, the rest should be simple.

Just grab the $_POST value in your .php script that corresponds to each checkbox. Then delete the data however it is being stored.

Post the code if you're having a problem with that aspect.
Sane is online now   Reply With Quote
Old Dec 9th, 2007, 6:15 AM   #3
sanch3za
Newbie
 
Join Date: Dec 2007
Posts: 3
Rep Power: 0 sanch3za is on a distinguished road
Question Re: delete data using checkbox

But I don't know how we using the chekbox before data delete. Please view me example code about this scenario :when i click DELETE button and i was checked the checkbox, field in mySQL Database have deleted according checkbox is checked. Please..Reply. Thank's before.
sanch3za is offline   Reply With Quote
Old Dec 9th, 2007, 10:24 AM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: delete data using checkbox

You have not shown any "example code about this scenario". Please do. I'm having a difficult time understanding you.
Sane is online now   Reply With Quote
Old Dec 9th, 2007, 9:27 PM   #5
sanch3za
Newbie
 
Join Date: Dec 2007
Posts: 3
Rep Power: 0 sanch3za is on a distinguished road
Re: delete data using checkbox

I mean, give me your example code "delete data using checkbox". When I click button DELETE, data in database MySQL have deleted according what i checked in the chekbox. i have printscreen about it [IMG]]http://img503.imageshack.us/img503/8950/checkboxzd3.th.jpg[/IMG].
Please reply. Thank's
sanch3za is offline   Reply With Quote
Old Dec 9th, 2007, 10:31 PM   #6
Sanjay Aggarwal
Newbie
 
Join Date: Oct 2007
Posts: 12
Rep Power: 0 Sanjay Aggarwal is an unknown quantity at this point
Re: delete data using checkbox

Please see the Javascript code-

if(para1=='Delete')
{
var flag=0;

for (i = 0; i < document.forms[0].elements.length; i++)
{
var e = document.forms[0].elements[i];
if (e.type == 'checkbox' && e.name!='selectall')//check for checkbox field
{

if(document.forms[0].elements[i].checked == true) //check checkbox status (checked or unchecked)
{
flag=1;
if(confirm('<?=_A_LOGICAL_DELETE_MSG?>'))
{
document.forms[0].submit();
}
break;//exit from the loop
}
}
}
if(flag==0)
{
alert('<?=_A_NO_SELECT_DELETE_MSG?>');
}
}

Sanjay Aggarwal
Sanjay Aggarwal is offline   Reply With Quote
Old Dec 10th, 2007, 7:24 PM   #7
ablaye
Newbie
 
Join Date: Dec 2007
Posts: 5
Rep Power: 0 ablaye is on a distinguished road
Re: delete data using checkbox

Sanjay,
Your code does not tell him how to delete those entries. It just check the data on submit.
ablaye is offline   Reply With Quote
Old Dec 10th, 2007, 9:27 PM   #8
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: delete data using checkbox

This thread is killing my brain cells with every word.

This is ridiculously vague. Post some code relative to your question about deleting the posted data. Or explain the specific problem in greater detail.

Maybe you need to check the "name" attribute of each checkbox. And make sure you're grabbing that specific $_POST parameter. But I have nothing to go on here...

All I've gotten out of your few posts so far are the words: "when I click delete mysql delete according checkbox". That won't get you very far in any language...

Details. Please.
Sane is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question regarding data input into PHP/Mysql using something other than GET davil PHP 6 Nov 20th, 2007 8:06 AM
convert unarrenged .txt data to arrange .txt data pastalover Visual Basic 2 Jun 23rd, 2006 4:22 PM
Recommended Practice for returning data from function Arla C# 1 Aug 16th, 2005 12:21 PM
help with sockets, having a client recieve data as well as send. cypherkronis Python 7 Jul 1st, 2005 5:59 PM
Help in QBASIC (I think it's similar to VB) phoenix987 Visual Basic 3 May 9th, 2005 12:33 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:47 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC