Denise Beck Posted February 29, 2008 Posted February 29, 2008 Hi there, unfortunately. without any knowledge of php, I am trying to use the dynamic menu and have encountered my first problem. The syntax of the following code is wrong and even though this subject was covered years ago, I don't know what to change where. It has to do with inverted commas and quotes. $result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd, ' . TABLE_CATEGORIES_TO_STORES . ' cc where c.categories_id = cd.categories_id and c.categories_id = cc.categories_id and cc.stores_id = "' . STORES_ID . '" and cd.language_id="' . (int)$languages_id .'" '.$parent_query.'order by sort_order, cd.categories_name'); Is there anybody that can help me out quickly? I have tried myself but now I get a blank screen rather than the error message 1064. Thanks, Denise Quote
satish Posted February 29, 2008 Posted February 29, 2008 paste the complete error. Satish Mantri Quote Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
Denise Beck Posted February 29, 2008 Author Posted February 29, 2008 Hi there, I got the error number wrong. It says: 1146 - Table 'mydatabase.TABLE_CATEGORIES_TO_STORES' doesn't exist select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd, TABLE_CATEGORIES_TO_STORES cc where c.categories_id = cd.categories_id and c.categories_id = cc.categories_id and cc.stores_id = "STORES_ID" and cd.language_id="1" order by sort_order, cd.categories_name paste the complete error. Satish Mantri Quote
Obewanz Posted February 29, 2008 Posted February 29, 2008 Hi there, I got the error number wrong. It says: 1146 - Table 'mydatabase.TABLE_CATEGORIES_TO_STORES' doesn't exist select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd, TABLE_CATEGORIES_TO_STORES cc where c.categories_id = cd.categories_id and c.categories_id = cc.categories_id and cc.stores_id = "STORES_ID" and cd.language_id="1" order by sort_order, cd.categories_name Denise, It would appear to me that you need to run the following sql statement using phpMyAdmin or similar tool; CREATE TABLE categories_to_stores ( categories_id int NOT NULL, stores_id int NOT NULL, PRIMARY KEY (categories_id,stores_id) ); If the table already exists you will get an SQL error stating that it was unable to create the table. (#1050 - Table 'categories_to_stores' already exists) Hope this helps... :) Quote The GraphicZoo check profile for web address
Denise Beck Posted February 29, 2008 Author Posted February 29, 2008 This is great, I looked up the database and it dawned on me that I don't need that table at all - so I left it out and now it works, at least in 1 browser. Thanks for sending me on the way. Denise Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.