Code: Select all
// Typical Database Initialization
$db = &$this->cms->db;
// mysql-specific, but ignored by other database
$taboptarray = array('mysql' => 'TYPE=MyISAM');
$dict = NewDataDictionary($db);
// table schema description
$flds = "
id I AUTO KEY,
job_title C";
// create it. This should do error checking, but I'm a lazy sod.
$sqlarray = $dict->CreateTableSQL(cms_db_prefix()."module_prosourcejobs",
$flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
die( "<pre>".print_r( $sqlarray )."</pre>".mysql_error() );
Here is what I get out when I install.
Array ( [0] => CREATE TABLE cms_module_prosourcejobs ( id INTEGER NOT NULL AUTO_INCREMENT, job_title VARCHAR, PRIMARY KEY (id) )TYPE=MyISAM )
1
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' PRIMARY KEY (id) )TYPE=MyISAM' at line 3
Am I missing something? Shouldn't there be a ) before PRIMARY KEY?