· 9 years ago · Dec 23, 2016, 07:18 AM
1a:5:{i:0;s:102:"SQLSTATE[42S02]: Base table or view not found: 1146 Table'demo_magento_dummy.pfay_test' doesn't exist";i:1;s:4361:"#0 /opt/lampp/htdocs/magento_new/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array)
2#1 /opt/lampp/htdocs/magento_new/app/code/core/Zend/Db/Statement.php(291): Varien_Db_Statement_Pdo_Mysql->_execute(Array)
3#2 /opt/lampp/htdocs/magento_new/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
4#3 /opt/lampp/htdocs/magento_new/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
5#4 /opt/lampp/htdocs/magento_new/lib/Varien/Db/Adapter/Pdo/Mysql.php(428): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
6#5 /opt/lampp/htdocs/magento_new/lib/Zend/Db/Adapter/Abstract.php(734): Varien_Db_Adapter_Pdo_Mysql->query('SELECT `main_ta...', Array)
7#6 /opt/lampp/htdocs/magento_new/lib/Varien/Data/Collection/Db.php(734): Zend_Db_Adapter_Abstract->fetchAll('SELECT `main_ta...', Array)
8#7 /opt/lampp/htdocs/magento_new/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(521): Varien_Data_Collection_Db->_fetchAll('SELECT `main_ta...', Array)
9
10<?php
11$installer = $this;
12$installer->startSetup();
13$installer->run("
14DROP TABLE IF EXISTS pfay_test;
15CREATE TABLE `pfay_test` (
16`id_pfay_test` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
17 `nom` VARCHAR( 50 ) NOT NULL ,
18 `prenom` VARCHAR( 50 ) NOT NULL ,
19 `telephone` VARCHAR( 20 ) NOT NULL
20 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
21");
22$installer->endSetup();
23
24<?xml version="1.0"?>
25<config>
26
27 <modules>
28 <Pfay_Test>
29 <version>0.1.0</version>
30 </Pfay_Test>
31 </modules>
32
33 <frontend>
34 <routers>
35 <routeurfrontend>
36 <use>standard</use>
37 <args>
38 <module>Pfay_Test</module>
39 <frontName>test</frontName>
40 </args>
41 </routeurfrontend>
42 </routers>
43
44 <layout>
45 <updates>
46 <test>
47 <file>test.xml</file>
48 </test>
49 </updates>
50 </layout>
51</frontend>
52
53<admin>
54 <routers>
55 <test>
56 <use>admin</use>
57 <args>
58 <module>Pfay_Test</module>
59 <frontName>admintest</frontName>
60 </args>
61 </test>
62 </routers>
63</admin>
64
65<adminhtml>
66 <layout>
67 <updates>
68 <test>
69 <file>test.xml</file>
70 </test>
71 </updates>
72 </layout>
73 <menu>
74 <test translate="title" module="adminhtml">
75 <title>My Plugins</title>
76 <sort_order>100</sort_order>
77 <children>
78 <set_time>
79 <title>Address Book</title>
80 <action>admintest/adminhtml_index</action>
81 </set_time>
82 </children>
83 </test>
84 </menu>
85</adminhtml>
86
87<global>
88 <blocks>
89 <test>
90 <class>Pfay_Test_Block</class>
91 </test>
92 </blocks>
93
94 <models>
95 <test>
96 <class>Pfay_Test_Model</class>
97 <resourceModel>test_mysql4</resourceModel>
98 </test>
99 <test_mysql4>
100 <class>Pfay_Test_Model_Mysql4</class>
101 <entities>
102 <test>
103 <table>pfay_test</table>
104 </test>
105 </entities>
106 </test_mysql4>
107 </models>
108
109<!-- allow the plugin to read and write -->
110
111 <resources>
112
113 <test_setup>
114 <setup>
115 <module>Pfay_Test</module>
116 </setup>
117 <connection>
118 <use>core_setup</use>
119 </connection>
120 </test_setup>
121<!-- connection to write -->
122
123 <test_write>
124 <connection>
125 <use>core_write</use>
126 </connection>
127 </test_write>
128<!-- connection to read -->
129
130 <test_read>
131 <connection>
132 <use>core_read</use>
133 </connection>
134 </test_read>
135 </resources>
136</global>
137
138<?php
139$installer = $this;
140$installer->startSetup();
141$installer->run("
142DROP TABLE IF EXISTS `{$installer->getTable('test/test')}`;
143CREATE TABLE `{$installer->getTable('test/test')}` (
144`id_pfay_test` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
145 `nom` VARCHAR( 50 ) NOT NULL ,
146 `prenom` VARCHAR( 50 ) NOT NULL ,
147 `telephone` VARCHAR( 20 ) NOT NULL
148 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
149");
150$installer->endSetup();