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 workmysql_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)");