通过php代码创建数据库表[关闭]

I need to create a database table by php code, but I want to use a variable as name of table, is it possible?, here is my code but it doesn't work
mysql_query("CREATE TABLE $table ( attempts INT, reset INT, error INT, total INT, loop_t INT, session_t INT)");

Please see Creating a mysql table with a PHP variable

Try adding backticks ` around the table name as in the example above

Try with quotes:

mysql_query("CREATE TABLE `".$table."` (attempts INT, reset INT, error INT, total INT, loop_t INT, session_t INT)");