Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Syntax, error 1064


Denise Beck

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

The GraphicZoo

check profile for web address

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...