Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default PHP warning error on Send Email to Customers

    I am not able to send e-mails in the admin control panel. When I go to Tools> Send Email my admin page is blank and I have this displaying in the window:
    Code:
    Send Email To Customers
      
    WARNING: An Error occurred, please refresh the page and try again.
    Obviously something is wrong, so I looked in my logs and found this on multiple dates:
    Code:
    [01-Dec-2012 16:33:51] PHP Warning:  constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant TABLE_SUBSCRIBERS in /MyRoot/public_html/store/includes/functions/audience.php on line 113
    [01-Dec-2012 16:33:51] PHP Fatal 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 'as s left join customers as c on c.customers_id = s.customers_id' at line 1 :: select c.customers_firstname, c.customers_lastname, s.email_address as customers_email_address from  as s left join customers as c on c.customers_id = s.customers_id   in /MyRoot/includes/classes/db/mysql/query_factory.php on line 120
    I am not sure what was causing this so I overwrote my original: admin> email.php file just in case it was corrupt and I have the same issue.

    In a previous installation I have had: newsletter_subscribe_2_2_2 so I likely still have these definitions in my database. I could not find the uninstall.sql that's why it's still in the database.
    I also installed: FEC v1.10.0. I am not sure if this is related.

    These are the only 2 modules that I think could have affected this (and maybe overwritten a core file). Any suggestions?

  2. #2
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: PHP warning error on Send Email to Customers


  3. #3
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: PHP warning error on Send Email to Customers

    Thank you bislewl I obviously did not find that thread in my forum search. I appreciate your time.

  4. #4
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: PHP warning error on Send Email to Customers

    The thread was closed so I could not post to it. As the 2 previous people had stated they removed the: "Newsletter Subscribers Only." I also removed the "Email test Group - Subscriber Only" since it seemed to be attached to the subscriber module.

    I am still seeing the same error in my e-mail area of my control panel.

    When I edit: "All Newsletter Subscribers" I see this query-string

    Code:
    select c.customers_firstname, c.customers_lastname, s.email_address as customers_email_address from TABLE_SUBSCRIBERS as s left join TABLE_CUSTOMERS as c on c.customers_id = s.customers_id
    How do I remove the table_subscribers (which I am assuming is left over from the old module)? Am I supposed to remove table_subscribers?

    Last, I do not know how to do this:
    The mod you said you removed has made a change to the queries in the query_builder table, adding a reference to the TABLE_SUBSCRIBERS table which you removed from your database.
    You'll need to put back the original record for that record in the database.
    This is what I have under query_builder:
    Code:
    query_id
    
    query_category
    
    query_name
    
    query_description
    
    query_string
    
    1
    
    email
    
    All Customers
    
    Returns all customers name and email address for s...
    
    select customers_email_address, customers_firstnam...
    
    2
    
    email,newsletters
    
    Customer Account Newsletter Subscribers
    
    Returns name and email address of newsletter subsc...
    
    select customers_firstname, customers_lastname, cu...
    
    3
    
    email,newsletters
    
    Dormant Customers (>3months) (Subscribers)
    
    Subscribers who HAVE purchased something, but have...
    
    select o.date_purchased, c.customers_email_address...
    
    4
    
    email,newsletters
    
    Active customers in past 3 months (Subscribers)
    
    Newsletter subscribers who are also active custome...
    
    select c.customers_email_address, c.customers_last...
    
    5
    
    email,newsletters
    
    Active customers in past 3 months (Regardless of s...
    
    All active customers (purchased something) in last...
    
    select c.customers_email_address, c.customers_last...
    
    6
    
    email,newsletters
    
    Administrator
    
    Just the email account of the current administrato...
    
    select 'ADMIN' as customers_firstname, admin_name ...
    
    7
    
    email,newsletters
    
    Customers who have never completed a purchase
    
    For sending newsletter to all customers who regist...
    
    SELECT DISTINCT c.customers_email_address as custo...
    
    8
    
    email,newsletters
    
    All Newsletter Subscribers
    
    Returns name and email address of all Customer Acc...
    
    select c.customers_firstname, c.customers_lastname...
    
    11
    
    email,newsletters
    
    Email Test Group - Customers
    
    Returns name and email address of Newsletter-only ...
    
    SELECT c.customers_email_address as customers_emai...
    
    12
    
    email,newsletters
    
    Permanent Account Holders Only
    
    Send email only to permanent account holders 
    
    select customers_email_address, customers_firstnam...
    I am afraid to remove anything without some advice.

  5. #5
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: PHP warning error on Send Email to Customers

    I have another installation of Zen Cart without the newsletter module installed. The only problem is the install is Zen version is 1.3.9h. I can go to the PHPMyAdmin and find the "query_builder" tables and copy or duplicate these directly into my newer installation (v1.5.1) to match the other installation. Is this advised?

  6. #6
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    672
    Plugin Contributions
    0

    Default Re: PHP warning error on Send Email to Customers

    OK. I was able to fix this issue. For those of you that have this same problem, you have to delete tables that newsletter_subscribe adds, to a certain area of your database. Go to your hosting control panel>PHP MyAdmin and find your database. Once you click on your stores database, find a main table called: "query_builder". Click on this and you will see all the queries related to this table.

    You only need 7 of these tables (at least up to v1.5.1) and these are the tables:
    Code:
    1 (query_id), email (query_category),All Customers (query_name), Returns all customers name and email address for s...(query_description)
    2 (query_id), email,newsletters (query_category),Customer Account Newsletter Subscribers (query_name), Returns all customers name and email address for s...(query_description)
    3 (query_id), email,newsletters (query_category),Dormant Customers (>3months) (Subscribers) (query_name), Subscribers who HAVE purchased something, but have...(query_description)
    4 (query_id), email,newsletters (query_category),Active customers in past 3 months (Subscribers) (query_name), Newsletter subscribers who are also active custome...(query_description)
    5 (query_id), email,newsletters (query_category),Active customers in past 3 months (Regardless of s... (query_name), All active customers (purchased something) in last...(query_description)
    6 (query_id), email,newsletters (query_category),Administrator (query_name), Just the email account of the current administrato...(query_description)
    7 (query_id), email,newsletters (query_category),Customers who have never completed a purchase (query_name), For sending newsletter to all customers who regist...(query_description)
    Your store creates tables called: query_id and numbers them 1-7. The newsletter module added tables 8-12. Just delete tables 8-12 and your e-mail system will work.

    A couple of notes:

    First, while my query_names. and query_descriptions changed between version 1.3.9h and 1.5.1 (or the newsletter module changed them) the most important factor called the "query_string" was identical for tables 1-7. Another words the module does not affect these tables (1-7). What I am saying is you should not have to touch table 1-7 just leave them be.

    Second, this is only for MySQL databases. If you have a Windows server it might be different.

    Third, this should fix any issues that is related to this old newsletter module migrated into the new store (v1.5.1). My errors were slightly different than the other post above. But I removed the old tables like they did and mine also worked.

    Last, I know nothing about databases so if I can do this anyone can. Just make a backup of your database and store before deleting these tables.

    Hope this helps someone who is having issues, but afraid to modify them directly in phpMyAdmin for your database.

  7. #7
    Join Date
    Jun 2008
    Location
    Singapore, Australia, America
    Posts
    96
    Plugin Contributions
    0

    Default Re: PHP warning error on Send Email to Customers

    I had newsletter_only installed before on 1.39h; now I am running on V1.5.1 engine, and also encounter the same problem.

    In the logs, the debug file states:
    [05-Jan-2013 21:55:49] PHP Fatal error: 1065:Query was empty :: in /public_html/includes/classes/db/mysql/query_factory.php on line 120

    I have deleted one line as shared by the sportsguy, but it still didn't work. Anyone knows what to do with this?

  8. #8
    Join Date
    Jun 2007
    Location
    Eustis, Florida, USA, EARTH
    Posts
    836
    Plugin Contributions
    0

    Default Re: PHP warning error on Send Email to Customers

    Love it when I dont have to ask a question to get my solution.

 

 

Similar Threads

  1. Replies: 4
    Last Post: 26 Jun 2015, 10:02 PM
  2. Replies: 3
    Last Post: 30 Oct 2014, 06:01 AM
  3. Send Email To Customers
    By FatGuyinAZ in forum General Questions
    Replies: 5
    Last Post: 1 Dec 2010, 03:09 AM
  4. trying to send email using tools > send email - get error
    By keylesslocks in forum General Questions
    Replies: 4
    Last Post: 24 Jan 2010, 05:05 PM
  5. Email send error warning
    By PortraitArtist in forum General Questions
    Replies: 2
    Last Post: 15 Apr 2008, 10:28 PM

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