Zen Cart Logo
Forums / Basic Configuration / HELP!!! Im missing a TABLE!!!

HELP!!! Im missing a TABLE!!!

Views: 2,194

Results 1 to 12 of 12
14 Apr 2010, 12:53 PM
#1
mistymurata avatar

mistymurata

New Zenner

Join Date:
Apr 2010
Location:
Phoenix, az
Posts:
39
Plugin Contributions:
0

HELP!!! Im missing a TABLE!!!

I'm missing a table in the database and need to add it again but need the correct database settings for it. This is the error message that I am getting:

1146 Table 'misty_zc1.TABLE_MUSIC_GENRE' doesn't exist
in:
[select music_genre_id, music_genre_name from TABLE_MUSIC_GENRE order by music_genre_name]

I really need some help with this I have been at this for days and cannot figure out a solution, I am so beyond frustrated. Here is the link to the site if you need to see if yourself
https://www.crazy-4-monograms.com/store

14 Apr 2010, 2:14 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: HELP!!! Im missing a TABLE!!!

mistymurata:

I'm missing a table in the database and need to add it again but need the correct database settings for it. This is the error message that I am getting:

1146 Table 'misty_zc1.TABLE_MUSIC_GENRE' doesn't exist
in:
[select music_genre_id, music_genre_name from TABLE_MUSIC_GENRE order by music_genre_name]

I really need some help with this I have been at this for days and cannot figure out a solution, I am so beyond frustrated. Here is the link to the site if you need to see if yourself
www.crazy-4-monograms.com/store

Go to /admin/tools/install _SQL_Patches, then run this SQL query:

CREATE TABLE IF NOT EXISTS music_genre (
  music_genre_id int(11) NOT NULL auto_increment,
  music_genre_name varchar(32) NOT NULL default '',
  date_added datetime default NULL,
  last_modified datetime default NULL,
  PRIMARY KEY  (music_genre_id),
  KEY idx_music_genre_name_zen (music_genre_name)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
```Cheers
Rod
14 Apr 2010, 2:23 PM
#3
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: HELP!!! Im missing a TABLE!!!

Ooops, scrap my previous reply, it probably won't do you any good.

mistymurata:

1146 Table 'misty_zc1.TABLE_MUSIC_GENRE' doesn't exist

You're not missing a table, you are missing a file (pehaps it is simply unreadable due to permissions).

The file contains (or should contain) the 'expansion' for the TABLE_MUSIC_GENRE definition.

On my system it appears to be
/includes/extra_datafiles/music_type_database_names.php

And line# 22 reads:
define('TABLE_MUSIC_GENRE', DB_PREFIX . 'music_genre');

... where 'music_genre' is the actual table name.

I suggest you check your file for a similar entry, and if all look ok check that the file is readable by the server.

Cheers
Rod

14 Apr 2010, 3:08 PM
#4
mistymurata avatar

mistymurata

New Zenner

Join Date:
Apr 2010
Location:
Phoenix, az
Posts:
39
Plugin Contributions:
0

Re: HELP!!! Im missing a TABLE!!!

YOU ARE AWESOME!!!! I LUV YA! Thankyou thankyou thankyou so very much! Everything is back as it should of been. I found the folder and apparently it just got dragged and dropped into the wrong place by accident so I was able to put it back where it should of been! I just started learning all this a few weeks ago and I gotta tell you this is as fun as it is frustrating. If I end up needing this something major for help are you for hire?

15 Apr 2010, 2:52 PM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: HELP!!! Im missing a TABLE!!!

mistymurata:

YOU ARE AWESOME!!!!

Now tell me something I don't know :D

mistymurata:

I LUV YA! Thankyou thankyou thankyou so very much! Everything is back as it should of been.

It is this kind of reply that makes it all worthwhile spending the time to help.
(If you hang around the forums long enough you'll come to understand what this really means).

mistymurata:

I found the folder and apparently it just got dragged and dropped into the wrong place by accident so I was able to put it back where it should of been!

I guess we both got lucky with this one, because that was one possibility that never even occurred to me. This could very easily have ended up in the situation whereby the best advise would have been to re-install.

mistymurata:

I just started learning all this a few weeks ago and I gotta tell you this is as fun as it is frustrating.

I agree 100%.

mistymurata:

If I end up needing this something major for help are you for hire?

I have been known to prostitute myself on occasion, but I do urge that before you consider asking me you should place your requests in the commercial help section of these forums.

Furthermore, I don't generally accept paid zencart jobs unless all avenues of solving the issues via the forums have been exhausted.. In other words I'd much rather spend the time teaching how to do or fix things than taking the money and doing it for you. (Hmmmm ... no wonder I'm not retired yet).

Cheers
Rod

20 May 2010, 1:12 PM
#6
rick29690 avatar

rick29690

New Zenner

Join Date:
May 2009
Location:
Travelers Rest, SC
Posts:
22
Plugin Contributions:
0

Re: HELP!!! Im missing a TABLE!!!

May I ask, could I use this for my problem also? When I click Manufacturers in the Admin=>Catelog/Products menu, I get the following:

"1146 Table 'nutsand_nutsandsuch_com.zenmeta_tags_manufacturers_description' doesn't exist
in:
[select metatags_keywords from zenmeta_tags_manufacturers_description where manufacturers_id = '11' and language_id = '1']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields."

Would the solution given to mistymurata work, with a change of terms?

Thanks! Rick

20 May 2010, 3:14 PM
#7
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: HELP!!! Im missing a TABLE!!!

Rick29690:

May I ask, could I use this for my problem also? When I click Manufacturers in the Admin=>Catelog/Products menu, I get the following:

"1146 Table 'nutsand_nutsandsuch_com.zenmeta_tags_manufacturers_description' doesn't exist
in:
[select metatags_keywords from zenmeta_tags_manufacturers_description where manufacturers_id = '11' and language_id = '1']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields."

Would the solution given to mistymurata work, with a change of terms?

Thanks! Rick

I gave two solutions (I didn't read the error message closely enough with my first 'solution'. )

It was my second solution that fixed the OP's problem, but this solution will NOT fix your problem. Your problem looks like something amiss with your DB prefix....

This line:
"nutsand_nutsandsuch_com.zenmeta_tags_manufacturers_description"

if even remotely correct, should read:
nutsand_nutsandsuch_com_zen_meta_tags_manufacturers_description where "nutsand_nutsandsuch_com_zen" is your DBprefix and "meta_tags_manufacturers_description" is the table name.

However, I suspect the correct prefix should simply be:
"zen_" or perhaps "username_zen" .

Until now, I've never seen a manipulated domain name (nutsand_nutsandsuch_com) be used as a prefix for a database name, and if that is correct, the underscores may also cause a problem or two.

Cheers
Rod

19 Jul 2010, 2:07 PM
#8
thegolfguru avatar

thegolfguru

New Zenner

Join Date:
Nov 2005
Posts:
68
Plugin Contributions:
0

Re: HELP!!! Im missing a TABLE!!!

Hi Rod,

My issue seems to be similar, yet I can't figure it out...needless to say I'm a novice at this.

I have a sidebox called 'Discount Corner' that used to work but no longer does. 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()]

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' (except /MYTESTSITE/includes/templates/template_default/sideboxes/tpl_discountcorner.php. I couldn't even bring up the home page when I changed that one!)

Since that change I no longer get the 1146 error, but Discount Corner does not show anything when you click on that page. However, from the sidebox, the discounted products all randomly cycle every refresh so I know there are products added to that section.

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.

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.

Any suggestions would be GREATLY appreciated!

my test site is dev.cornerhardware.com if you want to see the mess I've created :)

19 Jul 2010, 3:05 PM
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: HELP!!! Im missing a TABLE!!!

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

19 Jul 2010, 7:39 PM
#10
thegolfguru avatar

thegolfguru

New Zenner

Join Date:
Nov 2005
Posts:
68
Plugin Contributions:
0

Re: HELP!!! Im missing a TABLE!!!

Thank you so much for your in-depth response, Rod! I appreciate your help.

RodG:

Oh Boy, What a mess.

No argument there, the whole site is a mess this is just the tip of the ice burg!

RodG:

The usual question at this point is "what did you change or update"? The solution usually revolves around this cause.

I've "attempted" to change the sideboxes in the past with no success so there are some useless files floating around, but everything always worked after I put them back to original settings.

The only other thing I can think of is I had a part time programmer set up a test site for me (so I couldn't screw anything up too badly!), and this sidebox error, along with other sporadic error codes during checkout, started around the same time the test site went active. I would imagine he "copied" the database and folders from my live store (cornerhardware.com) and made a new "identical" site at dev.cornerhardware.com...however I don't know the process. Could this be the cause?

RodG:

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.

Oops :) Well at least it was a simple fix to put it back to how it was. One thing I did want to mention was that the admin for that sidebox in Catalog-->discount corner, redirected back to our home page long before I changed any of the file names...just in case that's of importance.

RodG:

The first thing to do is restore those filenames until you can get back to the original database error.

Done

RodG:

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"

I know very, very little about operating phpmyadmin, but from what I can see, the table is called zen_discountcorner.

RodG:

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.

I should probably already know all this, but I really don't understand what that sentence means! are you talking about finding the table prefix definition in phpmyadmin or through the zen admin or an ftp client? Maybe you know of a good FAQ or Tutorial that may explain all this? I'll look for one in the meantime. Needless to say, I do not know how to make the fix you suggest.

RodG:

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).

I'm not adverse to doing that, I would like to try and work it out if for nothing else than the educational value :)

Thanks again!

11 Mar 2011, 4:54 PM
#11
mr_chetanladdha avatar

mr_chetanladdha

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: HELP!!! Im missing a TABLE!!!

I have a similar problem.
Please visit my homepage https://www.krishwellness.com and to the right sidebox, there seems to be the error.

1146 Table 'krishwel_zc1.TABLE_MUSIC_GENRE' doesn't exist

I am stuck as to how to remove it.

Pls. Help.

Regards
Chetan

11 Mar 2011, 5:15 PM
#12
mr_chetanladdha avatar

mr_chetanladdha

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: HELP!!! Im missing a TABLE!!!

Hi Guys.. Could sort this out. Just change the file permissions and all got restored.
Thanks !