Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2005
    Posts
    30
    Plugin Contributions
    0

    Default 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!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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:
    Code:
    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');
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2005
    Posts
    30
    Plugin Contributions
    0

    Default 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

  4. #4
    Join Date
    Jul 2005
    Posts
    48
    Plugin Contributions
    0

    Default 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

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

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

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jul 2005
    Posts
    48
    Plugin Contributions
    0

    Default 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!!!!

 

 

Similar Threads

  1. Possible to send auto follow up email x days after order?
    By dgeere in forum General Questions
    Replies: 3
    Last Post: 14 Apr 2011, 10:33 AM
  2. No coupon-emails are send after installing newsletter subscribe addon
    By Robbie_79 in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 3 Jun 2010, 07:34 PM
  3. send gift cert error after uninstalling newsletter-subscribe addon
    By ian healy in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 26 Jan 2010, 06:58 PM
  4. Newsletter Email Confirmation (subscribe contrib)
    By trudesign in forum General Questions
    Replies: 6
    Last Post: 6 Sep 2008, 09:23 PM
  5. Newsletter Subscribe contrib error
    By tnc in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 1 Nov 2006, 03:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR