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 '' at line 1' in /home/radiolev/public_html/top/index.php:122 Stack trace: #0 /home/radiolev/public_html/top/index.php(122): PDOStatement->execute() #1 {main} thrown in /home/radiolev/public_html/top/index.php on line 122
Kod wygląda następująco:
$author = $_POST['author']; $title = $_POST['title']; $link = $_POST['link']; $addedby = $_POST['addedby']; $stmt = $db->prepare("INSERT INTO radiocms_toplistsongs(`sid`, `author`, `title`, `user`, `ytlink`, `votes`)VALUES('', ?, ?, ?, ?, 0"); $stmt->bindValue(1, $author); $stmt->bindValue(2, $title); $stmt->bindValue(3, $addedby); $stmt->bindValue(4, $ytlink); $stmt->execute();
oczywiscie polaczenie jest gdzies tam u gory sobie, wiec polaczenie na pewno jest nawiazane.