How To Delete Data By Checking The CheckBox - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How To Delete Data By Checking The CheckBox

RenzozukenRenzozuken Posts: 7Member
I need php coding to delete data

I want to make sure that the data deleted

#only data that is checked can be deleted
#data that are not checked cannot be deleted

so plz..........
help a programmer..


Comments

  • ManningManning Posts: 1,621Member
    : I need php coding to delete data
    :
    : I want to make sure that the data deleted
    :
    : #only data that is checked can be deleted
    : #data that are not checked cannot be deleted
    :
    : so plz..........
    : help a programmer..

    Give the checkboxes a common name. i.e. chkToBeDeleted. Give each checkbox a unique value. This value should identify the data in the database.

    When the form is submitted, $_POST['chkToBeDeleted'] will be a comma separated list of the values that were checked. You can use a simple SQL statement like this:

    SQL = "DELETE FROM mytable WHERE someid IN ({$_POST['chkToBeDeleted']})";

    Be sure to check that $_POST['chkToBeDeleted'] isn't blank first of course.
Sign In or Register to comment.