[thelist] creating a mySQL table dynamically in php

Jim Puls thelist at lists.evolt.org
Mon Jan 6 15:09:01 2003


You need to nix the comma after the second VARCHAR(12).

On Monday, January 6, 2003, at 03:02  PM, Tom Dell'Aringa wrote:

> I'm trying to create a table in my DB with a script. Here is the
> code:
> -----------------
> // connection stuff
>
> $sql  = " CREATE TABLE test  (";
> $sql .= "   pid    VARCHAR(12), ";
> $sql .= "   qty    VARCHAR(12), ";
> $sql .= " );  ";
>

> You have an error in your SQL syntax near '); ' at line 1
>