Below is a sample code:
$k = $pdo->query("INSERT INTO kategories SET user_id=$user_id, in_ex=?, name=?"); $k->execute(array($_POST['in_ex'], $_POST['katName'])); When do I replace? on 'pyfxtybz', then the script works. Why then with question marks does not work? Mistake:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE [42000]: Syntax error or access violation: 1064 You can have an error in your SQL syntax; check the syntax to use mySQL server; at line 1 'in C: \ web \ OpenServer \ domains \ test.loc \ tools.php on line 13