Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / 1064 Error after upgrading

1064 Error after upgrading

Views: 1,280

Results 1 to 8 of 8
4 May 2011, 12:06 AM
#1
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

1064 Error after upgrading

Please let me know what I need to do:

I upgraded from 1.3.9d to 1.3.9h, and am getting 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 'select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_' at line 1
in:
[select count(select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_group_pricing, a.entry_country_id, a.entry_company, ci.customers_info_date_of_last_logon, ci.customers_info_date_account_created , c.customers_telephone, a.entry_company, a.entry_street_address, a.entry_city, a.entry_postcode, c.customers_authorization, c.customers_referral, cgc.amount from zen_customers c left join zen_customers_info ci on c.customers_id= ci.customers_info_id left join zen_address_book a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id left join zen_coupon_gv_customer cgc on c.customers_id = cgc.customer_id order by ci.customers_info_date_account_created DESC) as total ]
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.

:

Database Host: localhost (127.0.0.1)Server OS: Linux 2.6.18-194.17.4.el5 Database: MySQL 5.0.92-communityServer Date: 05/03/2011 20:01:34 Database Date: 05/03/2011 20:01:34 Server Up Time: 20:01:34 up 175 days, 11:03, 0 users, load average: 1.35, 1.09, 0.95HTTP Server: ApachePHP Version: 5.2.11 (Zend: 2.2.0) PHP Memory Limit: 32MPHP Safe Mode: OffPHP File Uploads: On Max Size: 2MPOST Max Size: 8MDatabase Data Size: 2,309 kBDatabase Index Size: 494 kB
Zen Cart 1.3.9h

Database Patch Level: 1.3.9c

v1.3.9c [2010-07-02 20:16:54] (Version Update 1.3.8->1.3.9c)
v1.3.9c [2010-06-08 09:45:56] (Version Update 1.3.8->1.3.9c)
v1.3.8 [2009-02-02 00:28:54] (Version Update 1.3.7->1.3.8)
v1.3.7 [2009-02-02 00:26:57] (Version Update 1.3.6->1.3.7)
v1.3.6 [2009-02-02 00:26:42] (Version Update 1.3.5->1.3.6)
v1.3.5 [2009-02-02 00:26:23] (Version Update 1.3.0.2->1.3.5)
v1.3.0.2 [2009-02-02 00:25:33] (Version Update 1.3.0.1->1.3.0.2)
v1.3.0.1 [2009-02-02 00:16:44] (Version Update 1.3.0->1.3.0.1)
v1.3.0 [2009-02-02 00:15:37] (Version Update 1.2.7->1.3.0)
v1.2.7 [2006-03-08 13:06:10] (Fresh Installation)

4 May 2011, 12:14 AM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,178
Plugin Contributions:
0

Re: 1064 Error after upgrading

Do you have the following module installed Newsletter Subscribe

4 May 2011, 12:21 AM
#3
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1064 Error after upgrading

Looks like there is a newsletter and product notification link under Tools in her storeadmin, which I clicked on and get:
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 newsletters_id, title, length(content) as content_length, length(content_' at line 1
in:
[select count(select newsletters_id, title, length(content) as content_length, length(content_html) as content_html_length, module, date_added, date_sent, status from zen_newsletters order by date_added desc) as total ]
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.

So does that need upgraded?

4 May 2011, 1:21 AM
#5
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1064 Error after upgrading

Ok, my evil eye is almost closed after the long day I have had today. But I dont have all that the other person had. So, I deleted the only one that was similar, and it left me with :

1emailAll CustomersReturns all customers name and email address for sending mass emails (ie: for newsletters, coupons, GV's, messages, etc).select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS order by customers_lastname, customers_firstname, customers_email_address[3email,newslettersDormant Customers (>3months) (Subscribers)Subscribers who HAVE purchased something, but have NOT purchased for at least three months.select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o WHERE c.customers_id = o.customers_id AND c.customers_newsletter = 1 GROUP BY c.customers_email_address HAVING max(o.date_purchased) <= subdate(now(),INTERVAL 3 MONTH) ORDER BY c.customers_lastname, c.customers_firstname ASC4email,newslettersActive customers in past 3 months (Subscribers)Newsletter subscribers who are also active customers (purchased something) in last 3 months.select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o where c.customers_newsletter = '1' AND c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address order by c.customers_lastname, c.customers_firstname ASC5email,newslettersActive customers in past 3 months (Regardless of subscription status)All active customers (purchased something) in last 3 months, ignoring newsletter-subscription status.select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o WHERE c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address order by c.customers_lastname, c.customers_firstname ASC8email,newslettersAdministratorJust the email account of the current administratorselect 'ADMIN' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from TABLE_ADMIN where admin_id = $SESSION:admin_id9email,newslettersCustomers who have never completed a purchaseFor sending newsletter to all customers who registered but have never completed a purchaseSELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL1emailAll CustomersReturns all customers name and email address for sending mass emails (ie: for newsletters, coupons, GV's, messages, etc).select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS order by customers_lastname, customers_firstname, customers_email_address3email,newslettersDormant Customers (>3months) (Subscribers)Subscribers who HAVE purchased something, but have NOT purchased for at least three months.select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o WHERE c.customers_id = o.customers_id AND c.customers_newsletter = 1 GROUP BY c.customers_email_address HAVING max(o.date_purchased) <= subdate(now(),INTERVAL 3 MONTH) ORDER BY c.customers_lastname, c.customers_firstname ASC4email,newslettersActive customers in past 3 months (Subscribers)Newsletter subscribers who are also active customers (purchased something) in last 3 months.select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o where c.customers_newsletter = '1' AND c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address order by c.customers_lastname, c.customers_firstname ASC[5email,newslettersActive customers in past 3 months (Regardless of subscription status)All active customers (purchased something) in last 3 months, ignoring newsletter-subscription status.select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o WHERE c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address order by c.customers_lastname, c.customers_firstname ASC8email,newslettersAdministratorJust the email account of the current administratorselect 'ADMIN' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from TABLE_ADMIN where admin_id = $SESSION:admin_id[9email,newslettersCustomers who have never completed a purchaseFor sending newsletter to all customers who registered but have never completed a purchaseSELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL

1

email

All Customers
Returns all customers name and email address for sending mass emails (ie: for newsletters, coupons, GV's, messages, etc).
select customers_email_address, customers_firstname, customers_lastname from TABLE_CUSTOMERS order by customers_lastname, customers_firstname, customers_email_address

3

email,newsletters

Dormant Customers (>3months) (Subscribers)
Subscribers who HAVE purchased something, but have NOT purchased for at least three months.
select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o WHERE c.customers_id = o.customers_id AND c.customers_newsletter = 1 GROUP BY c.customers_email_address HAVING max(o.date_purchased) <= subdate(now(),INTERVAL 3 MONTH) ORDER BY c.customers_lastname, c.customers_firstname ASC

4

email,newsletters

Active customers in past 3 months (Subscribers)
Newsletter subscribers who are also active customers (purchased something) in last 3 months.
select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o where c.customers_newsletter = '1' AND c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address order by c.customers_lastname, c.customers_firstname ASC

5

email,newsletters

Active customers in past 3 months (Regardless of subscription status)
All active customers (purchased something) in last 3 months, ignoring newsletter-subscription status.
select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o WHERE c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address order by c.customers_lastname, c.customers_firstname ASC

8

email,newsletters

Administrator
Just the email account of the current administrator
select 'ADMIN' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from TABLE_ADMIN where admin_id = $SESSION:admin_id

9

email,newsletters

Customers who have never completed a purchase
For sending newsletter to all customers who registered but have never completed a purchase
SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM TABLE_CUSTOMERS c LEFT JOIN TABLE_ORDERS o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL

4 May 2011, 1:27 AM
#6
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1064 Error after upgrading

Sorry, I pasted more than once!

4 May 2011, 1:56 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: 1064 Error after upgrading

The query_builder data you posted looks fine.

The symptoms you're reporting suggest that something's wrong with the split_page_results code, since you're generating weird queries saying "select count(select ..." where "select" is used inside the count() function, which is an invalid syntax.

Maybe you've got some addon that's changed the core behavior of that class, or the file was damaged in your merge or download/upload process. Or maybe that's just a symptom of a deeper problem.

This is where I usually start with those kind of odd symptoms: http://www.zen-cart.com/wiki/index.php/Troubleshoot_-_Diagnosing_Obscure_Issues

4 May 2011, 2:25 AM
#8
countingsheep avatar

countingsheep

Zen Follower

Join Date:
Sep 2006
Posts:
154
Plugin Contributions:
0

Re: 1064 Error after upgrading

Thank you, I deleted and reloaded and it is now functioning. I appreciate the quick response! :)