Dynamic Table Name
Posted: Thu Nov 23, 2006 2:45 pm
Hi guys, I want to make a table for each user that is created and I want it to be named after the users username. I have the code but I cant seem to get the variable read in. Can you guys help me out? The sql is literally naming the table "$username"
Here is the code:
where $jack is the name of the table that is pulled from a query string(the value from query string is pulled fine.
thanks!
Here is the code:
Code: Select all
$createtable = 'CREATE TABLE IF NOT EXISTS $jack (`key` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `username` VARCHAR(40) NOT NULL,
`userbet` INT)';thanks!