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 Link to comment https://forums.phpfreaks.com/topic/82090-solved-query-update-problem/ 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 Link to comment https://forums.phpfreaks.com/topic/82090-solved-query-update-problem/#findComment-417119 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. Link to comment https://forums.phpfreaks.com/topic/82090-solved-query-update-problem/#findComment-417124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.