Jump to content

Mysql Error On Category Maint


craigfh

Recommended Posts

Here is the error I get when utilizing the - Rebuild category product count..

MySQL Error Occured

Error Message:

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 'SELECT DISTINCT cat_id FROM CubeCart_cats_idx WHERE 1) GROUP BY

SQL:

SELECT COUNT(cat_id) as count, cat_id FROM CubeCart_cats_idx WHERE cat_id IN(SELECT DISTINCT cat_id FROM CubeCart_cats_idx WHERE 1) GROUP BY cat_id

Any ideas how to fix this?

Link to comment
Share on other sites

Check your MySQL version. Chances are you're not meeting the software's minimum requirements. Talk to your hosting company. The requirements are not out of the norm....so your host may be running old stuff.

:sourcerer:

Link to comment
Share on other sites

Our version we are running is 4.0.25 which should be fine. I don't believe that could be the issue since everything else works fine. Plus I noticed the issue after I upgraded from 4.0.3 to the orc version.

thanks

Craig

Check your MySQL version. Chances are you're not meeting the software's minimum requirements. Talk to your hosting company. The requirements are not out of the norm....so your host may be running old stuff.

:)

Link to comment
Share on other sites

I also am having the same problem with "Rebuild category product count". My setup shows fine and is as follows:

CubeCart 4 Requirements Test

Ioncube Loader: Not Available

Zend Optimizer: Installed

GD Image Library: Version 2

PHP ≥ 4.3.0: 5.2.4

MySQL ≥ 4.1.0: 4.1.10

Congratulations.

Your server is compatible with CubeCart v4

The error message is:

MySQL Error Occured

Error Message:

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 'SELECT DISTINCT cat_id FROM CubeCart_cats_idx WHERE 1) GROUP BY

SQL:

SELECT COUNT(cat_id) as count, cat_id FROM CubeCart_cats_idx WHERE cat_id IN(SELECT DISTINCT cat_id FROM CubeCart_cats_idx WHERE 1) GROUP BY cat_id

Link to comment
Share on other sites

  • 4 weeks later...
Guest BIG Management

Can someone out there help adjust the SQL that is being called to accomplish the same thing ...

Original:

SELECT COUNT(cat_id) as count, cat_id FROM st1_CubeCart_cats_idx WHERE cat_id IN(SELECT distinct cat_id FROM st1_CubeCart_cats_idx WHERE 1)GROUP BY cat_id

Manually running in phpmyadmin ...

SELECT COUNT(cat_id) as count, cat_id FROM st1_CubeCart_cats_idx GROUP BY cat_id ...works fine.

Manually running in phpmyadmin ...

SELECT distinct cat_id FROM st1_CubeCart_cats_idx WHERE 1 ... works fine .

But manually running them in phpmyadmin with the "IN" causes the 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 'SELECT DISTINCT cat_id FROM st1_CubeCart_cats_idx WHERE 1) GROU

Checking the manual does me no good - can a sql person reply with a quick fix.

Thanks!

Link to comment
Share on other sites

Can someone out there help adjust the SQL that is being called to accomplish the same thing ...

Original:

SELECT COUNT(cat_id) as count, cat_id FROM st1_CubeCart_cats_idx WHERE cat_id IN(SELECT distinct cat_id FROM st1_CubeCart_cats_idx WHERE 1)GROUP BY cat_id

Manually running in phpmyadmin ...

SELECT COUNT(cat_id) as count, cat_id FROM st1_CubeCart_cats_idx GROUP BY cat_id ...works fine.

Manually running in phpmyadmin ...

SELECT distinct cat_id FROM st1_CubeCart_cats_idx WHERE 1 ... works fine .

But manually running them in phpmyadmin with the "IN" causes the 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 'SELECT DISTINCT cat_id FROM st1_CubeCart_cats_idx WHERE 1) GROU

Checking the manual does me no good - can a sql person reply with a quick fix.

Thanks!

What is the mySQL version?
Link to comment
Share on other sites

Guest BIG Management

Here are the versions I am using ...

CubeCart Version: Visit the CubeCart Downloads Server4.1.0RC2

PHP Version: 4.4.7

MySQL Version: 4.0.27-standard-log

Image upload folder size: 358.3 KB

Server Software: Apache/1.3.33 (Unix)

Client Browser: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11

Can someone out there help adjust the SQL that is being called to accomplish the same thing ...

Original:

SELECT COUNT(cat_id) as count, cat_id FROM st1_CubeCart_cats_idx WHERE cat_id IN(SELECT distinct cat_id FROM st1_CubeCart_cats_idx WHERE 1)GROUP BY cat_id

Manually running in phpmyadmin ...

SELECT COUNT(cat_id) as count, cat_id FROM st1_CubeCart_cats_idx GROUP BY cat_id ...works fine.

Manually running in phpmyadmin ...

SELECT distinct cat_id FROM st1_CubeCart_cats_idx WHERE 1 ... works fine .

But manually running them in phpmyadmin with the "IN" causes the 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 'SELECT DISTINCT cat_id FROM st1_CubeCart_cats_idx WHERE 1) GROU

Checking the manual does me no good - can a sql person reply with a quick fix.

Thanks!

Link to comment
Share on other sites

Guest BIG Management

You can't use nested SQL query because of old MySQL version.

OK ... So what would be the old way of doing it without nesting them?

Anyone?

Thanks

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