Creating an SQL table with email address as title

lil str kid

New Member
I'm struggling to create SQL tables using email addresses as the table name.The code I am using produces the following error:\[quote\] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@gmail.com( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR' at line 1\[/quote\]and the related code is:\[code\]// create new table for users tosses // Make a MySQL Connection mysql_connect("localhost", "$sqlusername", "$sqlpassword") or die(mysql_error()); mysql_select_db("$db_name") or die(mysql_error());// Create a MySQL table in the selected database mysql_query("CREATE TABLE $emailaddress( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), name VARCHAR(30), age INT)") or die(mysql_error()); \[/code\]It works just fine when I input a value from the variable \[code\]$emailaddress\[/code\] that is not an email address i.e. doesnt have an \[code\]@\[/code\] symbol, but it shows that error if it includes an \[code\]@\[/code\] symbol.
 
Back
Top