Code: Select all
$sqlcreate ='CREATE TABLE $id (
`id` INT NOT NULL AUTO_INCREMENT,
`userid` INT,
`rating` INT NOT NULL,
PRIMARY KEY ( `id` )
)';Above i have a standard table creation code. What I want is where it has $id I want it to actually create the table with the variable name.
So presuming $id = "hello" the table would be created with a name of "hello".
Currently it creates a table with a litteral name of "$id".
Does anyone have an idea of how to feed a variable into the table creation code?
I'm totally stumped! This is harder than I thought!