Database update using php?

BrandonS

New member
I'm having problems updating my mysql.. everything else works but when i put the rest of the code to post.. i get page canot be displayed..

<h1>modify info</h1>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>"; method="post">
Name <input type="text" name="inputName" value="<?php echo $person['Name']; ?>" /><br />
Description <input type="text" name="inputDesc" value="<?php echo $person['Description']; ?>" />
<br />
<input type="hidden" name="id" value="<?php $_GET['id']; ?>" />
<input type="submit" name="submit" value="Modify" />
</form>
<?php
if (isset($_POST['submit'])) {
$u = "UPDATE people SET 'Name'='$_POST[inputName]', 'Description'='$_POST[inputDesc]' WHERE ID = $_POST[id]";
mysql_query($u) or die(mysql_error());
echo "User has been created";
header("Location: index.php");
}
?>

This is the last of the code and then everything will work. Can someone PLEASEE HELP ME
 
Back
Top