A variable in a single quoted string will not be parsed. However, it will be parsed in a double-quoted string:
"CREATE TABLE IF NOT EXISTS $tabla (
`ID` int(2) NOT NULL AUTO_INCREMENT,
`Grupo` varchar(1),
`Local` char(30),
PRIMARY KEY (`ID`)
)
COLLATE=utf8_spanish_ci";
http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
Alternatively you can always concatenate it:
"CREATE TABLE IF NOT EXISTS " . $tabla . " (
`ID` int(2) NOT NULL AUTO_INCREMENT,
`Grupo` varchar(1),
`Local` char(30),
PRIMARY KEY (`ID`)
)
COLLATE=utf8_spanish_ci";