cant modify database i followed a tutorial but its seems to be incomplete?
This is the error message i get____________________
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
AND HERE IS THE CODE___________
<?php
error_reporting(E_ALL);
include 'connection.php';
if(!isset($_POST['submit'])) {
$q = "SELECT * FROM people WHERE ID = $_GET[id]";
$result = mysql_query($q);
$person = mysql_fetch_array($result);
}
error_reporting(0);
?>
<h1> You are Modifying A user</h1>
<form action="<?php echo $_SERVER ['PHP_SELF']; ?>" method="post">
Name<input type="text" name="inputName" value="<?php echo $person['Name']; ?>" />
Description<input type="text" name="inputDesc" value="<?php echo $person['Description']; ?>" />
<br />
<input type="hidden" name"id" value="<?php echo $_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 modified!";
header("Location: index.php");
}
?>
iam realy new to this so some one help plz.thnx
/best regards