Oh Boy, What a mess.
thegolfguru:
I have a sidebox called 'Discount Corner' that used to work but no longer does.
The usual question at this point is "what did you change or update"? The solution usually revolves around this cause.
thegolfguru:
I was getting the following error:
1146 Table 'chw_dev.zen_discount_corner' doesn't exist in: [select count(*) as total from zen_products p, zen_discount_corner s, zen_products_description pd where pd.products_id = s.products_id and p.products_id = s.products_id and s.status = '1' and p.products_quantity != '0' and p.products_status != '0' and s.expires_date>=NOW()]
OK, This is telling us is that one or more files contain this code, but the table being referred to doesn't exist.
At this stage, either creating the missing table, or modifying the file containing the erronious code are both viable fixes.
thegolfguru:
Since then I noticed some of my files and folders were titled 'discount_corner' and others were 'discountcorner'. I changed them all to 'discount_corner'
Sorry to tell you this, but this was probably the worst thing you could do. It doesn't (cannot) address the complaint indicated by the error message.
thegolfguru:
Since that change I no longer get the 1146 error,
This would be because one of those files that were renamed is one of those that contained the 'erronious' code, and by renaming the file it can no longer be found (by zencart), which means it never gets loaded, and the code that it contains will never execute, therefore, no error (Well, not the same error).
thegolfguru:
but Discount Corner does not show anything when you click on that page.
See previous paragraph... there is effectively one or more files 'missing' because they no longer have the correct names.
thegolfguru:
However, from the sidebox, the discounted products all randomly cycle every refresh so I know there are products added to that section.
This would be from a different piece of code that doesn't reside in a renamed file. This is a good observation though, because it indicates that the database tables probably DO all exist, so therefore it must be the calling code that is incorrect. (Remember at the start I said there were two possible fixes? Well, this narrows it down to one) :-)
thegolfguru:
Lastly, I cannot even access the page through the admin. When I go to admin -->catalog-->Discount Corner, I get redirected back to my home page.
Again, this will be caused by the renamed files.
thegolfguru:
This site has been around for several years and this featured products section was also created for this site long ago...however it used to work without problem...even after a recent large upgrade about 6 months ago.
The first thing to do is restore those filenames until you can get back to the original database error. Then I'd be using phpmyadmin to check the actual name of the 'discount_corner" to see how it compares with the reportedly missing table "chw_dev.zen_discount_corner"
From there it is a matter of trying to identify where the table prefix for this module is defined, and adjusting it to match the database table name.
To be perfectly honest though, you may find that the quickest/easiest solution is to delete and remove all evidence of the module and reinstall it from scratch (Taking careful note of any table prefixes).
Cheers
Rod