update query error
Posted: Tue Jun 05, 2007 8:53 am
anyone see why this does not work?
Error: 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 'surname='*****', email='**********', location='**********' at line 1
thanks
Code: Select all
<?php session_start();
if($_SESSION['user']['user_group'] == 'Administrator'){
} else {
echo '<meta http-equiv="refresh" content="0;URL=un-authorised.php" />';
exit();
};
include_once($_SERVER['DOCUMENT_ROOT'].'/includes/connection.php');
$title = $_POST['title'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$location = $_POST['location'];
$username = $_POST['username'];
$password = $_POST['password'];
$status = $_POST['status'];
$id = $_POST['id'];
$updateUsers = mysql_query("UPDATE users SET title='$title', firstname='$firstname' surname='$surname', email='$email', location='$location', username='$username', password='$password', status='$status' WHERE id='$id'"
)
or die(mysql_error());
echo '<meta http-equiv="refresh" content="0;URL=user_updated.php" />
';
?>
thanks