- Missing final semicolon (;)
DROP TABLE IF EXISTS {$this->getTable(
standards_values
)}; CREATE TABLE {$this->getTable(standards_values
)} (`standards_id` int(11) DEFAULT NULL, `value` varchar(250) DEFAULT NULL, `order` int(4) DEFAULT NULL, `value_id` int(8) NOT NULL AUTO_INCREMENT, UNIQUE KEY `value_id` (`value_id`), KEY `FK_standards_values` (`standards_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1
Should be:
DROP TABLE IF EXISTS {$this->getTable(`standards_values`)}; CREATE TABLE {$this->getTable(`standards_values`)} ( `standards_id` int(11) DEFAULT NULL, `value` varchar(250) DEFAULT NULL, `order` int(4) DEFAULT NULL, `value_id` int(8) NOT NULL AUTO_INCREMENT, UNIQUE KEY `value_id` (`value_id`), KEY `FK_standards_values` (`standards_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- No getTable used but thats a minor problem:
insert into
dimensions
(dimension_id
,label
,code
)
should be:
insert into {$this->getTable(
dimensions
)}(dimension_id
,label
,code
)
Good luck!
Reply to question:
This query works just fine in MySql i tested it. It was really just the semicolon missing.
DROP TABLE IF EXISTS standards; CREATE TABLE standards (
`standards_id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(250) DEFAULT NULL, PRIMARY KEY (`standards_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS standards_values; CREATE TABLE standards_values (
`standards_id` int(11) DEFAULT NULL, `value` varchar(250) DEFAULT NULL, `order` int(4) DEFAULT NULL, `value_id` int(8) NOT NULL AUTO_INCREMENT, UNIQUE KEY `value_id` (`value_id`), KEY `FK_standards_values` (`standards_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;