Jump to content

Recommended Posts

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.