Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2008
    Posts
    53
    Plugin Contributions
    0

    Default SQL error when trying to send e-mail.

    Hi all,

    I'm getting SQL errors when trying to email a customer, email coupons etc. I'm running 1.3.8a and have recently moved to a new server (Lunarpages).

    Any help will be much appreciated.

    Here's the error when trying to send a coupon.

    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 '= subdate(now(),INTERVAL 3 MONTH) ORDER BY c.customers_lastname, c.customers_fir' at line 1
    in:
    [select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from customers c, 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 ]
    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.
    Here's the error when trying to email from the customer list.

    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 '= subdate(now(),INTERVAL 3 MONTH) ORDER BY c.customers_lastname, c.customers_fir' at line 1
    in:
    [select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from customers c, 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 ]
    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.

  2. #2
    Join Date
    Oct 2008
    Posts
    53
    Plugin Contributions
    0

    Default Re: SQL error when trying to send e-mail.

    Surely someone has seen this error before and knows how to fix it?

  3. #3
    Join Date
    Oct 2008
    Posts
    53
    Plugin Contributions
    0

    Default Re: SQL error when trying to send e-mail.

    I'm not feeling the love

  4. #4
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: SQL error when trying to send e-mail.

    Hi,

    Do you know what version of mySql you are using.

    see your Admin->tools->server info page in the Zen Cart backend

  5. #5
    Join Date
    Oct 2008
    Posts
    53
    Plugin Contributions
    0

    Default Re: SQL error when trying to send e-mail.

    Database: MySQL 5.0.67-community

  6. #6
    Join Date
    Oct 2008
    Posts
    53
    Plugin Contributions
    0

    Default Re: SQL error when trying to send e-mail.

    Any further ideas guys i'm really loosing hope with this problem

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

    Default Re: SQL error when trying to send e-mail.

    There is a potential problem related to the HAVING or GROUP BY clause structure if you've got certain seldom-used STRICT mode settings (namely ONLY_FULL_GROUP_BY) enabled in your database, but if that were the problem it would be telling you that certain fields are missing from the GROUP BY clause, instead of telling you that you have a general syntax error.

    I've not been able to replicate the problem you're reporting. The syntax works fine.

    If the problem started after moving to a new server, then perhaps there's something amuck with your new server's configuration and may require engaging your new hoster's technical support team.
    .

    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.

  8. #8
    Join Date
    Jun 2005
    Location
    Pittsburgh
    Posts
    174
    Plugin Contributions
    0

    Default Re: SQL error when trying to send e-mail.

    DrByte -- I've reproduced this problem too. Migrated to a new server with 1.3.7 upgraded to 1.3.8a.

    Server OS: Linux 2.6.30.5-43.fc11.i686.PAE Database: MySQL 5.1.37
    Server Date: 09/16/2009 10:27:04 Database Date: 09/16/2009 10:27:04
    Server Up Time: 10:27:04 up 16:15, 0 users, load average: 0.00, 0.00, 0.00 HTTP Server: Apache/2.2.13 (Fedora)
    PHP Version: 5.2.9 (Zend: 2.2.0) PHP Memory Limit: 64M PHP Safe Mode: Off
    PHP File Uploads: On Max Size: 2M POST Max Size: 8M
    Database Data Size: 119,958 kB Database Index Size: 2,736 kB

    Error found: admin>tools>send mail>

    ADDITIONAL INFO FROM LOG FILE:
    PHP Warning: constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant TABLE_SUBSCRIBERS in /var/www/html/includes/functions/audience.php on line 113,

    I've not encountered any additional errors -- yet...

    Any ideas on where to look?

    Thanks in advance! Ken
    Last edited by rnet; 16 Sep 2009 at 03:35 PM.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,374
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: SQL error when trying to send e-mail.

    Quote Originally Posted by rnet View Post
    PHP Warning: constant(): Couldn't find constant TABLE_SUBSCRIBERS in /var/www/html/includes/functions/audience.php on line 113
    TABLE_SUBSCRIBERS is not part of a default Zen Cart install. It's something you added with an addon, presumably the "newsletter subscribe" addon. Inside that addon there has to be a file that defines TABLE_SUBSCRIBERS, and you need to have that file uploaded to your site in order for it to work. In fact, you probably need to do that for both the admin and non-admin sides of your site. So, go back and double check all the installation steps for that addon and make sure you've not missed anything or haven't broken something during your upgrade by wiping out one or more of its changes when replacing files.
    .

    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.

 

 

Similar Threads

  1. v153 sql error in admin mail.php - send mail and newsletters
    By delia in forum General Questions
    Replies: 1
    Last Post: 1 May 2015, 02:52 AM
  2. E-mail Error when trying to send email
    By weezee in forum General Questions
    Replies: 1
    Last Post: 21 Mar 2013, 10:28 PM
  3. 1064 error when trying to send customer email/newsletter
    By lj20272 in forum General Questions
    Replies: 14
    Last Post: 27 Aug 2012, 08:43 AM
  4. SQL error when trying to install the captcha_verification_antirobot_registration_1.4
    By fiberphile in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 16 Jan 2012, 04:50 PM
  5. Duplicate entry error when trying to send Gift Certificates
    By thegolfguru in forum General Questions
    Replies: 0
    Last Post: 10 Dec 2010, 07:54 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