I cannot find anything clear in the manual, but looking at user notes, the use of parameters is intended only for actual values, and not for table names, field names, etc.
Normal string concatenation should (and can) be used.
$tablename = "tablename"; $stmt = $dbh->prepare("CREATE TABLE `$tablename` (id foo, int bar,...)");
source share