Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2005
    Posts
    57
    Plugin Contributions
    0

    email error SQL error in "Send Email"

    When trying to utilize the Send Email function from Tools I'm getting the following SQL 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 '1''' at line 1
    in:
    [select customers_firstname, customers_lastname, customers_email_address from customers where customers_newsletter = ''1'' ]
    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.
    Any ideas on what I need to do to fix it?

  2. #2
    Join Date
    Oct 2006
    Posts
    624
    Plugin Contributions
    0

    Default Re: SQL error in "Send Email"

    Try going through the steps in troubleshooting your email problems as documented here.
    Goh Koon Hoek, author of "e-Start Your Web Store with Zen Cart".
    Printed book: www.lulu.com/content/10576284
    Electronic book and Errata: www.cucumbermedia.com/store

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

    Default Re: SQL error in "Send Email"

    This one's not an email problem.

    You'll need to manually edit the query record in the query_builder table and change ''1'' (quote quote one quote quote) to just '1' or even just 1

    The repeated quotation marks are likely a result of a PHP setting for magic_quotes_sybase on your server ... which can occasionally cause the extra quotes for supposed security.
    .

    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.

  4. #4
    Join Date
    Dec 2005
    Posts
    57
    Plugin Contributions
    0

    Default Re: SQL error in "Send Email"

    Quote Originally Posted by DrByte View Post
    This one's not an email problem.

    You'll need to manually edit the query record in the query_builder table and change ''1'' (quote quote one quote quote) to just '1' or even just 1

    The repeated quotation marks are likely a result of a PHP setting for magic_quotes_sybase on your server ... which can occasionally cause the extra quotes for supposed security.
    Thank you so much! I had no idea how to manually edit that record so I just grabbed the query_builder section from the SQL file in the zc_install folder and ran that as a query on my database and it fixed the problem.

    Thanks again!

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

    Default Re: SQL error in "Send Email"

    I hope you included the "drop table" command so that the already-existing records were removed as part of the process ... you don't want duplicates.
    .

    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
    Apr 2006
    Location
    Labuan Island
    Posts
    361
    Plugin Contributions
    2

    application error SQL error in "Send Email"

    what about this SQL syntax 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 ':admin_id' at line 1
    in:
    [select 'ADMIN' as customers_firstname, admin_name as customers_lastname, admin_email as customers_email_address from etoprace_admin where admin_id = $SESSION:admin_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.
    need help on this....
    [FONT=Comic Sans MS]"Whether you think you can, or you think you can't... YOU ARE RIGHT."[/FONT]
    [FONT=Comic Sans MS]GOOD LUCK !!![/FONT]

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

    Default Re: SQL error in "Send Email"

    That error suggests that you're using an outdated version of /includes/functions/audience.php. I believe the functionality that's missing was added in 1.3.7, maybe even 1.3.6. If you're getting that kind of message then you're running out-of-date code against newer database content.
    First make sure you've upgraded to the latest version of Zen Cart. Then make sure that file is also matching the version you're running.
    .

    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
    Apr 2006
    Location
    Labuan Island
    Posts
    361
    Plugin Contributions
    2

    Default SQL error in "Send Email"

    oh, yes...now i remember..i upgraded my databases from v1.3.0.1 to the latest current version but all my codes is still v1.3.0.1...is there any temporary fix for this as i am still doing the upgrading...
    [FONT=Comic Sans MS]"Whether you think you can, or you think you can't... YOU ARE RIGHT."[/FONT]
    [FONT=Comic Sans MS]GOOD LUCK !!![/FONT]

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

    Default Re: SQL error in "Send Email"

    As I said, do your upgrade, and ensure the file I mentioned is current.

    You really should NEVER upgrade a live site directly. You should always do it on a test site first. Upgrade documentation references are described here: https://www.zen-cart.com/tutorials/index.php?article=98
    .

    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.

  10. #10
    Join Date
    Apr 2006
    Location
    Labuan Island
    Posts
    361
    Plugin Contributions
    2

    application error SQL error in "Send Email"

    thank you DrByte...I'd just replaced the audience.php file with the latest version...seems to be working but only for Rich-Text Messages...when you sent the Text-Only Messages, seems the message is empty...
    [FONT=Comic Sans MS]"Whether you think you can, or you think you can't... YOU ARE RIGHT."[/FONT]
    [FONT=Comic Sans MS]GOOD LUCK !!![/FONT]

 

 

Similar Threads

  1. v153 When order is in "Processing" status send email to third party
    By jdlauletta in forum General Questions
    Replies: 0
    Last Post: 6 Nov 2014, 08:07 PM
  2. Show a "send me an email when in stock" button
    By ilmarchez in forum Managing Customers and Orders
    Replies: 1
    Last Post: 5 May 2012, 12:51 PM
  3. "Send Test Email" Mailbeez error
    By gangees in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Apr 2012, 12:43 PM
  4. v139h Duplicate emails in "Send Email" need advise
    By chrontronic in forum General Questions
    Replies: 3
    Last Post: 26 Mar 2012, 11:02 PM
  5. Customer's First Name in "Send Email"
    By ryanb4614 in forum Customization from the Admin
    Replies: 1
    Last Post: 8 Mar 2012, 02:42 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