Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 以magento方式创建表_Mysql_Magento_Magento 1.7 - Fatal编程技术网

Mysql 以magento方式创建表

Mysql 以magento方式创建表,mysql,magento,magento-1.7,Mysql,Magento,Magento 1.7,我试图学习如何使用一本书中的示例创建表,但没有成功。模块在那里,但表没有创建。我找不到错误,也不知道如何调试它。 有办法调试它吗? 有人能告诉我我做错了什么吗? 谢谢 您可以检查的内容很少: 已启用清除缓存 如果您的模块设置记录与的相同,请检查核心资源表 您的模块版本在config.xml文件中定义,安装 脚本无法运行。您必须删除该条目或运行 升级脚本 如果不是这样,请检查您的安装文件是否被调用。如果没有,则需要检查config.xml。它应该类似于: <models>

我试图学习如何使用一本书中的示例创建表,但没有成功。模块在那里,但表没有创建。我找不到错误,也不知道如何调试它。 有办法调试它吗? 有人能告诉我我做错了什么吗? 谢谢


您可以检查的内容很少:

  • 已启用清除缓存
  • 如果您的模块设置记录与的相同,请检查核心资源表 您的模块版本在config.xml文件中定义,安装 脚本无法运行。您必须删除该条目或运行 升级脚本
如果不是这样,请检查您的安装文件是否被调用。如果没有,则需要检查config.xml。它应该类似于:

<models>
    <giftregistry>
        <class>Mdg_Giftregistry_Model</class>       
        <resourceModel>giftregistry_resource</resourceModel>
    </giftregistry>
    <giftregistry_resource>
         <class>Mdg_Giftregistry_Model_Resource</class>
         <entities>
               <type>
                    <table>your_table_name</table>
               </type>
         </entities>
    </giftregistry_resource>
</models>    

    <resources>
     <giftregistry_setup>
         <setup>
            <module>Mdg_Giftregistry</module>
            <class>Mage_Core_Model_Resource_Setup</class>
         </setup>
         <connection>
              <use>core_setup</use>
         </connection>
      </giftregistry_setup>
    </resources>

千年发展目标礼品物流模式
礼品库资源
千年发展目标礼品物流模式资源
您的\u表\u名称
千年发展目标礼物学
图像\核心\模型\资源\设置
核心单元设置
虽然没有测试过,但是您的config.xml应该有类似的代码,这里有一个链接可以帮助您,如果仍然不起作用的话

<models>
    <giftregistry>
        <class>Mdg_Giftregistry_Model</class>       
        <resourceModel>giftregistry_resource</resourceModel>
    </giftregistry>
    <giftregistry_resource>
         <class>Mdg_Giftregistry_Model_Resource</class>
         <entities>
               <type>
                    <table>your_table_name</table>
               </type>
         </entities>
    </giftregistry_resource>
</models>    

    <resources>
     <giftregistry_setup>
         <setup>
            <module>Mdg_Giftregistry</module>
            <class>Mage_Core_Model_Resource_Setup</class>
         </setup>
         <connection>
              <use>core_setup</use>
         </connection>
      </giftregistry_setup>
    </resources>