Php 关于magento中的数据库自定义模块
如果我在magento中的模块名为Php 关于magento中的数据库自定义模块,php,magento,Php,Magento,如果我在magento中的模块名为quote,请查看生成数据库的代码: <?php $installer = $this; $installer->startSetup(); $installer->run(" -- DROP TABLE IF EXISTS {$this->getTable('quote')}; CREATE TABLE {$this->getTable('quote')} ( `quote_id` int(11) unsigned N
quote
,请查看生成数据库的代码:
<?php
$installer = $this;
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('quote')};
CREATE TABLE {$this->getTable('quote')} (
`quote_id` int(11) unsigned NOT NULL auto_increment,
`product_id` int(11) unsigned NOT NULL,
`name` varchar(255) NOT NULL default '',
`surname` varchar(255) NOT NULL default '',
`mail` varchar(255) NOT NULL default '',
`message` text NOT NULL default '',
`status` smallint(6) NOT NULL default '0',
`created_time` datetime NULL,
`update_time` datetime NULL,
PRIMARY KEY (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
");
$installer->endSetup();
您在config.xml中称它为什么?大致如下:
<models>
<quote_mysql4>
<entities>
<quote>
<table>table_name</table>
</quote>
</entities>
</quote_mysql4>
</models>
表名称