I've hit a wall with a PDO insert:
$q = $dbh->prepare('INSERT INTO grant (grant_name, update) VALUES (?,?)');
$q->bindParam(1, $grant_name, PDO::PARAM_STR);
$q->bindParam(2, $update, PDO::PARAM_STR);
$q->execute();
I get an error:
PHP Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
But I cannot find the problem. I have tried using placeholder (such as :grant_name) and using the question marks (?).
updatein backticks.$grant_name.GRANTis a reserved word as well!