atticus Posted December 17, 2007 Share Posted December 17, 2007 I am updating mysql server and having problems with the syntax, the data is posting form the form: <?php include("config.php"); if(isset($_POST['submit'])) { $id = mysql_escape_string($_POST['cust_id']); $lastname = mysql_escape_string($_POST['last_name']); $firstname = mysql_escape_string($_POST['first_name']); $username = mysql_escape_string($_POST['username']); $password = mysql_escape_string($_POST['password']); $phone = mysql_escape_string($_POST['phone']); echo $id, $lastname, $firstname, $username, $password, $phone; $query = "UPDATE client SET last_name = '$lastname', first_name = '$firstname', username ='$username', password = 'PASSWORD('$password')', phone = '$phone' WHERE cust_id = '$id'"; mysql_query($query) or die('Error, insert query failed' . mysql_error()); error: Error, insert query failedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'jjjjjjjjj')', phone = 'jjjjjjjjj' WHERE cust_id = '18'' at line 4 Quote Link to comment Share on other sites More sharing options...
PHPNewbie55 Posted December 17, 2007 Share Posted December 17, 2007 It looks like password = 'PASSWORD('$password')', should be password = '$password', 'jjjjjjjjj')', phone Quote Link to comment Share on other sites More sharing options...
rlindauer Posted December 17, 2007 Share Posted December 17, 2007 password = 'PASSWORD($password)', Remove the quotes from $password. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.