Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL errors with a fresh installation


brentonv

Recommended Posts

Posted

I realise this question is with regard to a deriviative of osCommerce, although the primary cause of my problem seems to stem from osCommerce itself. I have just installed AABox.com osCMax V1.7 (September 2004) and am getting the following error when using the admin panel with an empty database.

 

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 '-10, 10' at line 1

 

select manufacturers_id, manufacturers_name, manufacturers_image, date_added, last_modified from manufacturers order by manufacturers_name limit -10, 10

 

This error is being reported from:

 

Catalog -> Manufacturers

Catalog -> Reviews

Catalog -> Specials

Catalog -> Products Expected

 

From memory it is also apprearing in a few other places.

 

This is occurring on a fresh install of Apache, PHP, MySQL and osCMax.

All install files were downloaded in the last 24-hours and should be the latest available. I am not sure if I?ve got everything ?tweaked? just right although it does seem to work with the exception of this error. This install is on Win-XP and in-house.

 

This is my first install of all of these programs so I'm a little confused.

Can anyone offer any suggestion as to where I should start looking?

 

After playing with both osCommerce and oscMAX for a while, I have worked out that both products do this when there is no record in a table. Basically, if there is no record in a table, the Admin tool can't access the database and osc blows-up, so you can't add the first record. Catch-22 :(

 

Is this normal ?

Is there something I can or should modify in the code to stop this occuring ?

 

How do you get around this ?

What am I doing wrong ?

Is it a config or setup issue ? If so, where should I start looking ?

 

Sorry if this sounds like a dumb question. Yes, I'm a newbie :P

Posted

Sometimes this happens on installation when the whole of the database does not get set up correctly (tables missing). In phpMyAdmin, delete the existing database (assuming it's new with nothing you need to keep), create a new one of the same name, and import the data from the oscommerce.sql file into it - and then see if it works.

 

Vger

Posted

Thanks for the reply Vger. I found the problem. It is an old bug in osCommerce which will hit people who attempt a clean install on the latest versions oof MySQL. There was also a bug in versions of MySQL prior to 4.0 which allowed the bug in osCommerce to work sorta-kinda :)

 

The fix can be found HERE

 

Can I suggest that the Mods make this thread sticky as new people like myself with current versions of everything will keep getting hit by this.

Posted

The mods don't use stickies for common problems. Don't ask me why they don't, it's not as if I haven't suggested it!

 

Vger

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...