$table_name = "test";
$a ="r1,r2,r3,r4";
i want to explode this
$products = (explode(",",$a));
after exploding i will get the answer as
foreach($a as $x)
{
echo $x;
}
$x through these variable i want to create column in table in database.
i wrote the query as follow
"CREATE TABLE $table_name".
'(id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
'.$x.' varchar(30))'
after this the table should be created in database but it is not.Why I am getting the solution.Please guide me