I'm trying to create a delete button that lets a user "delete" an entry from mysql database.
I have a demo.php page, where my php connects to my database and inserts data into it.
And I have a demo-form.php which is to display the form and when "submit" button is clicked calls the demo.php.

//demo.php page

 mysql_connect("localhost", "username", "password") or die(mysql_error()); 
 mysql_select_db("demo") or die(mysql_error()); 
 mysql_query("INSERT INTO `demoform` VALUES ('$fname', '$lname', '$address', '$city', '$state', '$zip')"); 
 Print "Your information has been successfully added to the database."; 

//demo-form page

<form action="demo.php" method="post">
First Name: <input type="text" name="fname" /></br>
Last Name: <input type="text" name="lname" /></br>
Address: <input type="text" name="address" /></br>
City: <input type="text" name="city" /></br>
State: <input type="text" name="state" /></br>
Zip/Postal Code: <input type="text" name="zipcode" /></br>
<input type="submit" value="Submit" />
<input type="submit" value="Delete" />//this one i just typed in. doesn't work yet.

Am I on a right track? My "Submit" works. It is adding data to table.
But I'm kinda stuck with my "Delete" one.

Edited by super-duper: n/a

6 Years
Discussion Span
Last Post by vaultdweller123

1st you got to create a list view for person, you can list them up using <ul> then have them assign checkboxes each, then assign some id on every checkbox so you can specify which record to delete

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.