[thelist] php+mySQL

Mark Joslyn mark.joslyn at solimarsystems.com
Thu May 23 13:48:00 CDT 2002


[snip]
You need to treat the query for table creation the same as any other query.

$createsql = "CREATE TABLE $db_tablename ($name char(20) NOT NULL ";
$createsql .= "$description char(50) NOT NULL ";
$createsql .= "$version char(20) NOT NULL) ";

Don't forget to concat variables in these statements, and make sure the user
has grants to create, and make sure to flush!
[/snip]

There was an error in my original code snippit.

It should have read:

mysql_query("CREATE TABLE $db_tablename ($name char(20) NOT
NULL,$description
char(50) NOT NULL,$version char(20) NOT NULL)");

Jay, not sure how separating the commands will help. Still not sure where I
am going wrong.

Any additional thoughts are greatly appreciated.

Thanks,

markJ










More information about the thelist mailing list