Mam problem przy wpisywaniu danych do bazy.
$stmt = $pdo -> prepare("INSERT INTO ".$tabela[1]." (:login, pass, email, name, surname) VALUES (:login, :pass, :email, :name, :surname)"); $stmt->bindParam(':login', $_POST['login'], PDO::PARAM_STR, 255); $stmt->bindParam(':pass', sha1($_POST['pass'])); $stmt->bindParam(':email', $_POST['email'], PDO::PARAM_STR, 255); $stmt->bindParam(':name', $_POST['name'], PDO::PARAM_STR, 255); $stmt->bindParam(':surname', $_POST['surname'], PDO::PARAM_STR, 255); $stmt -> execute();
Błąd:
( [0] => 42000 [1] => 1064 [2] => 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 ''test1', pass,
Zapewne będzie to problem z cudzysłowami.
Ma ktoś pomył ja go rozwiązać.