Привет всем, делаю запросы к базе через PDO и при их исполнении PDO выдает такую ошибку
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 ''15' LIKE oF_tour_table_template' at line 1' in /engine/classes/tournament.class.php:45 Stack trace: #0 /engine/classes/tournament.class.php(45): PDOStatement->execute(Array) #1 /ajax.php(102): Tournament->acceptTour('7', '123', '123', '123', 'Hearthstone', 'Olympia', 'Regular', '2015/07/08 23:3...', 'Regular games B...', '1OMG,Rinyuaru,r...', '12312457', '3123123') #2 {main} thrown in/engine/classes/tournament.class.php on line 45
Код на этой строке вот такой вот:
if(!$tableCreate->execute(array($lastid['LAST_INSERT_ID()'])) || !$pretableCreate->execute(array($lastid['LAST_INSERT_ID()'])) || !$dbdelete->execute(array($id))){
return false;
}
Сам запрос выглядит так:
$tableCreate = $this->db->prepare("CREATE TABLE IF NOT EXISTS oF_tour_table_? LIKE oF_tour_table_template");
$pretableCreate = $this->db->prepare("CREATE TABLE IF NOT EXISTS oF_tour_pretable_? LIKE oF_tour_pretable_template");
$this->db->query("UPDATE oF_tour_cPanel SET tourtablename = 'fgerfge', tourpreregtable = 'fgerfge' WHERE id = '".$lastid['LAST_INSERT_ID()']."'");
$dbdelete = $this->db->prepare("DELETE FROM oF_tour_cPanel_M WHERE id = ?");
Как решить эту проблему?
Спасибо