Digitry Designs Posted January 26, 2010 Share Posted January 26, 2010 Ok, here is what i have. I am trying to use a form where user types out the name of something in the row. upon submit the row is deleted. User is not editing php so hardcoding wont work. I am able to delete all rows, but I want to delete just what was input into the form. Here is what i have <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("time_sheets", $con); $sql = "DELETE FROM jobs VALUES ('$_POST[jobs],$_POST[jobID]') "; echo "Row deleted!"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Jobs updated"; mysql_close($con) ?> <html> <head> ...You are being redirected to the jobs update form. <meta http-equiv="refresh" content="1;url=list.php"> </head> <title>Jobs updated</title> </html> Any help is very apreciated! Thank you in advance! Quote Link to comment https://forums.phpfreaks.com/topic/189805-deleting-specific-rows-from-database-with-_post/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.