Zen Cart Logo
Forums / General Questions / Fatal error: mysql error (1064 error) -- v1.0-alpha

Fatal error: mysql error (1064 error) -- v1.0-alpha

Locked

Views: 6,981

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
27 Mar 2007, 3:15 AM
#1
dale_schibbelhut avatar

dale_schibbelhut

New Zenner

Join Date:
Dec 2003
Location:
Denver Colorado
Posts:
60
Plugin Contributions:
1

Fatal error: mysql error (1064 error) -- v1.0-alpha

I have a cart that has been working correctly for some time. I'm not sure what version it is but I suspect it's an older version. (Where do I find the version?) When we try to add products to the catalog we now get the following error when we go into the Catalog>Categories / Products section. Does anybody have any idea what has caused this error and what we need to do to fix it.

Fatal error: mysql 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 '-10, 10' at line 1] in EXECUTE("select p.products_id, pd.products_name, p.products_model, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute, p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.products_quantity_order_max from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name limit -10, 10") in /home/roadware/public_html/includes/classes/adodb/adodb-errorhandler.inc.php on line 139

27 Mar 2007, 6:25 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

Yes, you definitely have a very old version -- something prior to v1.2.0.
You can see the version number under Admin->Tools->Server Info

Were there any recent changes to your hosting plan ? ie: a switch to newer PHP or MySQL versions?

Were there any recent customizations installed on your site?

Does running a Database Repair via phpMyAdmin (on each table individually) or cPanel (entire database) solve the problem?

30 Mar 2007, 2:23 AM
#3
dale_schibbelhut avatar

dale_schibbelhut

New Zenner

Join Date:
Dec 2003
Location:
Denver Colorado
Posts:
60
Plugin Contributions:
1

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

I tride the suggestions you gave but they didn't work. I suspect the mysql database has been updated. the problem hasn't showed up before because they haven't added products sence 2004.

I checked the version and it says "Zencart Alpha Relese" so it is old and needs updated. Mysql is version 4.4.2.

I coppied lines 129 through 139 from the file below. It says the error is on 129. I suspect the error is somewhere in that code but I'm not a PHP expert. Does anybody see anything that needs to be changed to make this work untill we have time to upgrade.

if (defined('ADODB_ERROR_LOG_TYPE')) {

$t = date('Y-m-d H:i:s');

if (defined('ADODB_ERROR_LOG_DEST'))

error_log("($t) $s", DODB_ERROR_LOG_TYPE, ADODB_ERROR_LOG_DEST);

else

error_log("($t) $s", ADODB_ERROR_LOG_TYPE);

30 Mar 2007, 6:30 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

Try editing /admin/includes/classes/split_page_results.php
on line 49 you have:$offset = ($max_rows_per_page * ($current_page_number - 1));Insert a new line below it and add the following:```
// fix offset error on some versions
if ($offset < 0) { $offset = 0; }


Hopefully this will stop the -10 from appearing, and start at 0 instead.
31 Mar 2007, 4:07 AM
#5
dale_schibbelhut avatar

dale_schibbelhut

New Zenner

Join Date:
Dec 2003
Location:
Denver Colorado
Posts:
60
Plugin Contributions:
1

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

DrByte
Thank you very much! That fixed the problem.
Thanks
Dale

31 Mar 2007, 4:31 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

You're welcome.

I strongly recommend you upgrade. Considering you're working with such old code, I would suggest that your "upgrade" actually be a "redo" of the site, using the new code.

31 Mar 2007, 3:18 PM
#7
dale_schibbelhut avatar

dale_schibbelhut

New Zenner

Join Date:
Dec 2003
Location:
Denver Colorado
Posts:
60
Plugin Contributions:
1

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

I was also thinking it would be the best way. I'm wondering how much trouble it's goin to be to import the database into a new cart.

1 Apr 2007, 5:14 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

Dale Schibbelhut:

I was also thinking [upgrading] would be the best way. I'm wondering how much trouble it's goin to be to import the database into a new cart.

Easy.
Backup the old database.
Import it to a new database for testing.
Upgrade it.
Customize the site (files etc)
Then move the new 'files' to the old site, and upgrade the old database in-place.

It's documented in the various instructions docs which can be found in the /docs folder of your Zen Cart files.

18 Nov 2010, 11:28 AM
#9
petike1007 avatar

petike1007

New Zenner

Join Date:
Nov 2010
Posts:
1
Plugin Contributions:
0

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

Hi!
I've got this message,when i try to send a newsletter?
Anyone knows the solution?

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 email_format != 'NONE' and confirmed = 1 and (customers_id IS NULL or cust' at line 1
in:
[SELECT email_address as customers_email_address FROM WHERE email_format != 'NONE' and confirmed = 1 and (customers_id IS NULL or customers_id = 0) order by email_address ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

18 Nov 2010, 7:08 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Fatal error: mysql error (1064 error) -- v1.0-alpha

You've installed an addon that alters or adds records in the query_builder table, and now you've got something in there that's got bad syntax, and is thus triggering your error.