Hey,
I'm working on a newsroom automation script in PHP. I've got just about everything down, except for one thing. I'm trying to create a page that will create a new table--you know, you enter the name for the table in a textbox, then the script runs a MySQL query to create the table.
This is probably a stupid question, but I can't get this to work. I want to plug in a script that basically runs the following query:
CREATE TABLE '$table' (id int(6) NOT NULL ... etc etc
I think the problem with the above line of code is the fact that MySQL recognizes the apostrophes to be the end of the query--but if I try to run the query without them, it names the table $table. Does anyone have a solution to this?
As you can probably tell, I'm still learning PHP.
I'm working on a newsroom automation script in PHP. I've got just about everything down, except for one thing. I'm trying to create a page that will create a new table--you know, you enter the name for the table in a textbox, then the script runs a MySQL query to create the table.
This is probably a stupid question, but I can't get this to work. I want to plug in a script that basically runs the following query:
CREATE TABLE '$table' (id int(6) NOT NULL ... etc etc
I think the problem with the above line of code is the fact that MySQL recognizes the apostrophes to be the end of the query--but if I try to run the query without them, it names the table $table. Does anyone have a solution to this?
As you can probably tell, I'm still learning PHP.