[thelist] creating a mySQL table dynamically in php

Jim Puls jim at nondifferentiable.com
Mon Jan 6 15:09:01 CST 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
>




More information about the thelist mailing list