I am trying to create a platform where tables can be created from a php from and named as the variable that the submitter types. The code I have here has causes a mysql syntax error. I believe it is a matter of parenthesis placement but every combination I have tryed ha been unsuccessful can anyone figure it out? I have taken out the incorrect parenthesis to make it less confusing
<?php
if (isset($_POST['submit']))
{
$name=$_POST['name'];
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());
mysql_query("CREATE TABLE '$name'(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
name VARCHAR(30),
age INT)")
or die(mysql_error());
echo "Table Created!";
?> <html><form method='POST'>..........</html>