Help, can't update data fields.

wxdqz

New Member
Hi everybody,
I am trying to update some data fields, but some how it isn't working. Hopefully someone will notice where's my mistake. Both parts (DELETE and INPUT) work fine on their own, but when put together they don't.
Thanks in advance for your time and help.
Jorge

Code:-

<?track_varsINI?>

<?php include("required1.php");

$query1 = "DELETE FROM $tablename WHERE (id = '$id')";

$query2 = "INSERT INTO $tablename(id, date, name, etc)
VALUES ('"
.$HTTP_POST_VARS["id"]."','"
.$HTTP_POST_VARS["date"]."','"
.$HTTP_POST_VARS["name"]."','"
.$HTTP_POST_VARS["etc"]."')";


$success = 0;
$connection = mysql_pconnect($host, $user, $password);
if (!$connection)
{
die("Couldn't establish a connection with the server .");
return;
}
else
{
$queryres = mysql_db_query($dataname, $query, $connection);
if ($queryres) $success = 1;

mysql_close($connection);
}
Header("Location: start.php?success=$success");
 
Back
Top