Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Discount groups


MWebb

Recommended Posts

I am trying to install Dicount groups version 1.1.1 I seem to have edited everything correctly. However when I go to to do something other than create a new group, I get this error

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and c.categories_id = g.categories_id and c.categories_id = f.categories_id orde' at line 1

 

I get different versions of these when I click on: Edit, Delete, or if I go into edit and then update.

 

I've tried using the fix in this link

 

http://www.oscommerce.com/forums/topic/144095-1064-you-have-an-error-in-your-sql-syntax/

 

but it doesn't solve the problem.

 

If anyone can help it would be greatly appreciated.

Link to comment
Share on other sites

Ok the error that I get after clicking edit is this:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and c.categories_id = g.categories_id and c.categories_id = f.categories_id orde' at line 1

 

select c.discount, c.categories_id, c.customers_groups_id, g.categories_name, f.parent_id from groups_to_categories c, categories_description g, categories f where c.customers_groups_id= and c.categories_id = g.categories_id and c.categories_id = f.categories_id order by g.categories_name

 

[TEP STOP]

 

And the error I get if I click the delete button is this:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

delete from groups_to_categories where customers_groups_id=

 

[TEP STOP]

 

If I go through edit and then click update, I get this error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customers_groups_id =' at line 1

 

update customers_groups set customers_groups_name='', customers_groups_discount= where customers_groups_id =

 

[TEP STOP]

 

And finally if I go through edit and then insert I get this error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

 

select * from groups_to_categories where categories_id=0 and customers_groups_id=

 

[TEP STOP]

Link to comment
Share on other sites

I've also just noticed that when I log in as a customer and then click on a product (any product) I get this message.

 

1146 - Table 'oscommerce_0.TABLE_GROUPS_TO_CATEGORIES' doesn't exist

 

select discount from TABLE_GROUPS_TO_CATEGORIES where customers_groups_id = 2 and categories_id=0

 

[TEP STOP]

 

I've looked at my database and there is a table called groups_to_categories does exist

Link to comment
Share on other sites

Regarding syntax errors: Post the query as it is in the file, not the error messages just

 

Regarding last error: 1146 - Table 'oscommerce_0.TABLE_GROUPS_TO_CATEGORIES' doesn't exist

 

You don't have the table defined in includes/database_tables.php

Link to comment
Share on other sites

Think that the define may be in includes/application_top.php in this case!

 

It is an older addon are you tying to use this on a 2.3 shop??

Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

HI,

 

seems to me it is this addon

 

http://addons.oscommerce.com/info/1288

 

According to the install the defines are made in application_top.php

 

Doubt very much if it would be suitable for a 2.3 shop hence the question.

 

Regards

Joli

To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

I don't know the add-on and yes, if instructions say that any "defines" should go to application_top.php, then it is a very old one

 

For the "define" it self: If the store has a file includes/database_tables.php and if that file is included in includes/application_top.php (as it happens in all newer stores) then you can add that define to file includes/database_tables.php, the result will be exactly same: The constant is defined.

 

OP's issue in last post is, that a constant used is not defined

Link to comment
Share on other sites

  • 1 month later...

@@joli1811 Yes it is that add-on that I'm trying to use. I'm trying to get it so that I can create multiple customer groups and give each group a discount, this is the only add-on that seems to "work" for me. I've managed to fix the error regarding 1146 - Table 'oscommerce_0.TABLE_GROUPS_TO_CATEGORIES' doesn't exist

 

however

 

@@multimixer I am still getting all of the syntax errors.

 

ps I haven't logged in in a while as I've been doing other things but I'm back on this project now and I saw that you had added a bit more to the conversation so I'd thought I'd update my situation.

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