我创建了一个扩展,当我在其他版本上测试它时,它给了我错误
Error in file: "/var/www/mage_sample/app/code/local/MYD/Module/sql/findyoursize_setup/mysql4-install-0.1.0.php" - SQLSTATE[42000]: Syntax error or access violation: 1064 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 '' at line 1.
当我在 sql 中尝试相同的代码时,它可以工作。任何人都可以帮助解决问题吗?我尝试了很多,现在卡住了。以下是我的安装程序代码:
$installer = $this;
$installer->startSetup();
$installer->run("
DROP TABLE IF EXISTS {$this->getTable('dimensions')};
CREATE TABLE {$this->getTable('dimensions')} (
`dimension_id` int(11) NOT NULL AUTO_INCREMENT,
`label` varchar(250) DEFAULT NULL,
`code` varchar(250) DEFAULT NULL,
PRIMARY KEY (`dimension_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS {$this->getTable(`standards`)};
CREATE TABLE {$this->getTable(`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 {$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
insert into {$this->getTable('dimensions')}(`dimension_id`,`label`,`code`) values (1,'Chest','chest');
insert into `dimensions`(`dimension_id`,`label`,`code`) values (2,'Waist','waist');
insert into `dimensions`(`dimension_id`,`label`,`code`) values (3,'Inseam ','inseam ');
insert into `dimensions`(`dimension_id`,`label`,`code`) values (4,'Hips','hips');
insert into `dimensions`(`dimension_id`,`label`,`code`) values (5,'Thigh','thigh');
insert into `dimensions`(`dimension_id`,`label`,`code`) values (6,'Weight','weight');
insert into `dimensions`(`dimension_id`,`label`,`code`) values (8,'Neck','neck');");
$installer->endSetup();