Re: CREATE TABLE QUERY PHP/MySQL
| From: | Jason Wong | Date: | Fri, 06 Dec 2002 21:25:46 +0000 |
| Subject: | Re: CREATE TABLE QUERY PHP/MySQL | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23889@lists.php.net to get a copy of this message | ||
On Saturday 07 December 2002 05:00, Jonathan wrote:
> This is the first time I am trying to create a table in MySQL based on
> user input.
>
> Here is the scenario,
>
> The user will enter in the name of a stage, e.g. Harley Davidson.
> I then look for the first space (to indicate the first word), make it
> into lower case and then do the following:
>
> $new_stage_name = "stage_".$var;
>
> This will give $new_stage_name the value of "stage_harley".
>
> That works fine.
>
> Now I want to run the following query:
>
> $SQL = "CREATE TABLE ".$new_stage_name." (set values and their
> properties)";
>
> If I run this query using PHPMyAdmin, minus the var of course, the table
> is created.
>
> When I run it in my code, nothing happens. I do a die($SQL) to see the
> final outcome of the query and it's correct and is what I am using to
> run the query in PHPMyAdmin.
mysql_error() to see what the problem is.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
"...and the fully armed nuclear warheads, are, of course, merely a
courtesy detail."
*/