atticus Posted November 13, 2007 Share Posted November 13, 2007 I am having problems with this query: $username = $_POST['username']; $password = $_POST['password']; $query = "INSERT INTO cust (cust_id, cust_password) VALUES ('$username', PASSWORD('$password');"; 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 '' at line 1 Link to comment https://forums.phpfreaks.com/topic/77173-problem-inserting-password-into-field/ Share on other sites More sharing options...
rajivgonsalves Posted November 13, 2007 Share Posted November 13, 2007 should be query = "INSERT INTO cust (cust_id, cust_password) VALUES ('$username', PASSWORD('$password'))"; you forgot the ) Link to comment https://forums.phpfreaks.com/topic/77173-problem-inserting-password-into-field/#findComment-390737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.