I am trying to work on a login and registration page and I am making a new database and i can do it fine like this:
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// Execute query
mysql_query($sql,$con);
and what I am trying to do is replace the "persons" with a string so that it makes a table but it is dynamic. I need a string because I am making a table for each user that registers and the new table's name is their username and password send through an md5sum encryption. I've tried this with no success it wont make a new table like the other one does :
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE $data
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// Execute query
mysql_query($sql,$con);
Please help me. I've tried joining strings together with no luck so I need help.