![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2007
Posts: 3
Rep Power: 0
![]() |
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] |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
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. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Dec 2007
Posts: 3
Rep Power: 0
![]() |
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.
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() |
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.
|
|
|
|
|
|
#5 |
|
Newbie
Join Date: Dec 2007
Posts: 3
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Oct 2007
Posts: 12
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Dec 2007
Posts: 5
Rep Power: 0
![]() |
Re: delete data using checkbox
Sanjay,
Your code does not tell him how to delete those entries. It just check the data on submit.
__________________
Custom Web Design | Webmaster Forum General Web Directory | Buy or Sell Banners and Links |
|
|
|
|
|
#8 |
|
Programming Guru
![]() |
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |