I'm using CakePHP 2.9.9.
I want to use prepared statement in query method, but got syntax error.
code is below
$query = 'CREATE TABLE IF NOT EXISTS ? (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY)';
$this->User->query($query, array('dynamic_table_name'));
error message is this.
Error: 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 ''dynamic_table_name' (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY)' at line 1
Why escape by single quote like ''dynamic_table_name' ?
How to fix it?