Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / 1146 Error : Query Category table

1146 Error : Query Category table

Locked

Views: 573

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
11 Oct 2010, 06:58
#1
rej2k7 avatar

rej2k7

New Zenner

Join Date:
Aug 2010
Location:
Bangalore
Posts:
9
Plugin Contributions:
0

1146 Error : Query Category table

Hi,

I am in need of creating a slide, where i have to query table (categories), i got it working excellent on local host, zc, but when i check with server i got mysql error no : 1146

Its running with 5.0 mysql db.
I dont know what went wrong, please help.

:(
Thanks
Reji.

11 Oct 2010, 11:20
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: 1146 Error : Query Category table

Error 1146 is "Table Name Doesn't Exist". Did you use the TABLE_CATEGORIES constant to call the name of your table, or did you just put "categories" in the SQL? You MUST use the TABLE_xxxxx constants when writing SQL statements, as they take into consideration any table name prefixes.

So your SQL should look like:

$categories_rs = $db->Execute("SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION." cd WHERE c.categories_id = cd.categories_id AND cd.languages_id = '".(int)$_SESSION['languages_id']."'");

.... or similar.

Absolute

12 Oct 2010, 12:36
#3
rej2k7 avatar

rej2k7

New Zenner

Join Date:
Aug 2010
Location:
Bangalore
Posts:
9
Plugin Contributions:
0

Re: 1146 Error : Query Category table

Thanks a lot .. :smile: