Wednesday 26 December 2018

php - Syntax error or access violation: 1064

So here's my problem I get this error





Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'key) VALUES ('email@email' , '6b7d4d69e7595943da5bfb5723ceb3ef2e559275')' at line 1' in /Users/matt/Desktop/Likes/forgot/f.php on line 39




When trying to run this code



$gen = $con->prepare("INSERT INTO reset (user, key) VALUES (:user , :key)");
$gen->bindValue(':user', $username, PDO::PARAM_STR);
$gen->bindValue(':key', $token, PDO::PARAM_STR);
$gen->execute();



Any ideas? I'm binding both values so I'm not sure what's wrong. I've also went over and checked for syntax errors, but couldn't find any.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...