Zen Cart Logo
Forums / Upgrading from 1.2 to 1.3.x / send email db error after updating, possible clash with subscribe contrib

send email db error after updating, possible clash with subscribe contrib

Locked

Views: 2,752

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
1 Jun 2006, 12:56 AM
#1
organism avatar

organism

New Zenner

Join Date:
Oct 2005
Posts:
30
Plugin Contributions:
0

send email db error after updating, possible clash with subscribe contrib

ok, so on 1.2.5 I had the subscribe contrib installed, wherein people could place themselves on the mailing list without having to sign up. I no longer use the contrib, but the changes that it made to my db now cause an error to pop up when I try to send an email, it says

Warning: constant(): Couldn't find constant TABLE_SUBSCRIBERS in /home/fragg2/public_html/zen/includes/functions/audience.php on line 113
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 'as s left join zen_customers as c on c.customers_id = s.custome
in:
[select c.customers_firstname, c.customers_lastname, s.email_address as customers_email_address from as s left join zen_customers as c on c.customers_id = s.customers_id ]
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.

is there any way to clear out the changes made by the subscribe contrib to the table in question?
thanks much in advance!

1 Jun 2006, 4:57 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: send email db error after updating, possible clash with subscribe contrib

The subscribe contribution recommended some changes to the queries in the "query_builder" table. Running the following via phpMyAdmin should reset them to original defaults:```
truncate table query_builder;
INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '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');
INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '2', 'email,newsletters', 'All Newsletter Subscribers', 'Returns name and email address of newsletter subscribers', 'select customers_firstname, customers_lastname, customers_email_address from TABLE_CUSTOMERS where customers_newsletter = '1'');
INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '3', 'email,newsletters', 'Dormant Customers (>3months) (Subscribers)', 'Subscribers who HAVE purchased something, but have NOT purchased for at least three 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');
INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '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');
INSERT INTO query_builder ( query_id , query_category , query_name , query_description , query_string ) VALUES ( '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');

1 Jun 2006, 6:53 PM
#3
organism avatar

organism

New Zenner

Join Date:
Oct 2005
Posts:
30
Plugin Contributions:
0

Re: send email db error after updating, possible clash with subscribe contrib

DrByte, thanks very much for your help, that did the trick nicely, I'm sure this will end up helping a lot of people who upgraded after having the subscribe contrib

16 Jun 2006, 1:20 AM
#4
prellis avatar

prellis

New Zenner

Join Date:
Jul 2005
Posts:
46
Plugin Contributions:
0

Re: send email db error after updating, possible clash with subscribe contrib

I get the following errror when running this via PHPmyADMin...

Error

SQL query:

TRUNCATE TABLE query_builder;

MySQL said: Documentation
#1146 - Table 'prellis_zc1.query_builder' doesn't exist

16 Jun 2006, 3:49 AM
#5
drbyte avatar

drbyte

Sensei

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

Re: send email db error after updating, possible clash with subscribe contrib

That likely suggests that you have prefixes on your tablenames.
Do all your tables in phpMyAdmin start with "zen_" ?
If so, add "zen_" before "query_builder" on all those SQL statements.

Are you attempting this because you had the subscribe contribution installed and are removing it? Or are you trying to solve some other situation?

16 Jun 2006, 7:47 PM
#6
prellis avatar

prellis

New Zenner

Join Date:
Jul 2005
Posts:
46
Plugin Contributions:
0

Re: send email db error after updating, possible clash with subscribe contrib

Dr. Byte:

YOUR A GENIOUS!!!! That worked like a charm...

I had the suscribe contribution previously but have since removed it (using PHPlist currently) Had not had a problem until I went to use the "Mail GV" in Admin (or send any other type of email via admin) it gave me the "Warning: constant(): Couldn't find constant TABLE_SUBSCRIBERS"

Your code worked...THANK YOU!!!!