chaddro / EasyPopulate-4.0

Data import and export module for Zencart 1.3.x and 1.5.x
GNU General Public License v2.0
24 stars 31 forks source link

Error received before uploading and after #16

Closed ksshehata closed 8 years ago

ksshehata commented 10 years ago

MySQLi error 1146: Table 'mrshehata9_zc1.zc_products_with_attributes_stock' doesn't exist When executing: SHOW COLUMNS FROM zc_products_with_attributes_stock using EP4 and open office also I downloaded a file made some corrections and tried to uploaded, I got the same error. Thanks.

mc12345678 commented 9 years ago

Forgive me for not "looking" in the issues area possibly in a long time. This is an indication that you still have a table definition for Stock by Attributes (some version or another) in your files. Suggest using the Developer's Toolkit under tools of the admin panel. Search for: 'TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK' (with the quote) and you are likely to find a file that includes something similar to: define('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK', DB_PREFIX.'products_with_attributes_stock');

but it could be a variation on that information. Wherever the file is, if you no longer need/use stock by attributes, then I would suggest removing that file. In the short term could change the extension of the file from .php to something other than .bak or .old and definitely not .php4, .php5, etc...

Again, sorry for not noting this comment/issue being out there. Basically was an incomplete uninstallation of some version of Stock By Attributes from the files of the site.

mc12345678 commented 8 years ago

Looks like while the test for the PHP relationship to the database table works successfully, a test to verify that the table exists would be a good next step to this test in case the original SBA files have not been removed. Fortunately the test function (ep_4_SBA1Exists) is infrequently called so the operations on the database are minimized to once per evolution of the file(s). Perhaps could also set a session variable to minimize the calls if that becomes considered necessary, but then would also at some point need to clean up that session which might require additional code elsewhere which all just seems like too much.. Anyways, leaving myself a note here about the type of check that needs to be incorporated so that this issue can be closed. Before operating this test, the Table constant should be verified to not only be defined, but also to not be "empty". Then the following can be tested and if there are results other than 0 or false, then the additional table checks can be performed:

SELECT * 
FROM information_schema.tables
WHERE table_schema = 'yourdb' 
    AND table_name = '<?php echo TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK; ?>'
LIMIT 1;
mc12345678 commented 8 years ago

Added check for SBA database into admin\functions\extra_functions\easypopulate_4_functions.php as part of the check (Now looks for database file definition as well as database table itself).