Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default MAX_JOIN_SIZE rows email customers not working

    Hi i have a client using zen cart and has tried to send an email from the website and they now get the following error message


    1104 The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
    in:
    [SELECT DISTINCT c.customers_email_address as customers_email_address, c.customers_lastname as customers_lastname, c.customers_firstname as customers_firstname FROM customers c LEFT JOIN orders o ON c.customers_id=o.customers_id WHERE o.date_purchased IS NULL ]
    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.



    I contacted my hosting provider and they gave me the following info


    MySQL will refuse to execute select statements that process a very large number of rows. You should either adjust your select statement to make it more efficient, or set SQL_BIG_SELECTS=1 in the session before executing the large select statement. Use something like this to do that ..

    $db->sql_query("SET OPTION SQL_BIG_SELECTS=1");


    but i have no idea what this means??? what do I need to do to increase this so it will fix the problem??

    I then contacted them again saying i didnt understand how to do this and they said the following

    You need to send . You can either do it on the page throwing the error, or set it on a global level by including the query after the database connection. The syntax is likely to differ depending on the software in use, so if you are having trouble using this you may want to review the software documentation or community forums as its very likely this has occurred in the past

    am still as lost as i first was, how do i send "SET OPTION SQL_BIG_SELECTS=1" before the query is executed??

    can anyone help please,

    below is a screen shot of how the contact customers pag now looks


  2. #2
    Join Date
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default Re: MAX_JOIN_SIZE rows email customers not working

    can anyone help me please?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: MAX_JOIN_SIZE rows email customers not working

    Admin->Configuration->Email Options->Audience-Select Count Display --- set this to false.
    Audience-Select Count Display
    When displaying lists of available audiences/recipients, should the recipients-count be included?
    (This may make things slower if you have a lot of customers or complex audience queries)
    .

    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
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default Re: MAX_JOIN_SIZE rows email customers not working

    Quote Originally Posted by DrByte View Post
    Admin->Configuration->Email Options->Audience-Select Count Display --- set this to false.
    Hi ive change this but this hasnt fixed it, when i click on email customers its still displaying the error like the image below


  5. #5
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: MAX_JOIN_SIZE rows email customers not working

    That query is from the pulldown menu that offers various customer-lists to send to, and specifically refers to the one that deals with "customers who have never placed an order".

    It's very rare that you'd encounter such an error using that query unless you've done something to mass-import hundreds or thousands of customers into your database without any corresponding purchases associated with them. Or maybe mass-deleted a huge number of orders, thus orphaning the customers.

    When did this problem first start happening?
    What's been changed on your site lately?
    .

    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
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default Re: MAX_JOIN_SIZE rows email customers not working

    Quote Originally Posted by DrByte View Post
    That query is from the pulldown menu that offers various customer-lists to send to, and specifically refers to the one that deals with "customers who have never placed an order".

    It's very rare that you'd encounter such an error using that query unless you've done something to mass-import hundreds or thousands of customers into your database without any corresponding purchases associated with them. Or maybe mass-deleted a huge number of orders, thus orphaning the customers.

    When did this problem first start happening?
    What's been changed on your site lately?
    Hi it was all working fine then my client put an email together to send to all the newsletter subscribers. she then clicked send then got this error message and now its permanently there when they click on email customers.... how will i remove / fix this so they can then send emails again?? nothing has been changed on the site.

    any help would be appreciated
    thanks

  7. #7
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: MAX_JOIN_SIZE rows email customers not working

    This doesn't seem like something caused by Zen Cart. More likely something your hosting company did to restrict limits because others were abusing them.

    You have a few options, all of which are destructive:
    a) start deleting records from the query_builder table in your database. This will remove various options from the available lists of recipients in admin screens.
    b) delete customers which have never made purchases
    or, less destructive:
    c) follow the SET SQL_BIG_SELECTS=1 suggestion by your hosting company, by writing custom code to run the SQL statement, perhaps in a custom file you'd place in your /admin/includes/extra_configures/ folder.

    Make backups before you do anything.
    .

    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
    Aug 2007
    Posts
    95
    Plugin Contributions
    0

    Default Re: MAX_JOIN_SIZE rows email customers not working

    Quote Originally Posted by DrByte View Post
    This doesn't seem like something caused by Zen Cart. More likely something your hosting company did to restrict limits because others were abusing them.

    You have a few options, all of which are destructive:
    a) start deleting records from the query_builder table in your database. This will remove various options from the available lists of recipients in admin screens.
    b) delete customers which have never made purchases
    or, less destructive:
    c) follow the SET SQL_BIG_SELECTS=1 suggestion by your hosting company, by writing custom code to run the SQL statement, perhaps in a custom file you'd place in your /admin/includes/extra_configures/ folder.

    Make backups before you do anything.
    hi thanks for the info when you say the following

    c) follow the SET SQL_BIG_SELECTS=1 suggestion by your hosting company, by writing custom code to run the SQL statement, perhaps in a custom file you'd place in your /admin/includes/extra_configures/ folder.


    do you have any idea on how to do this?? could you provide me with the coding for the file??

    please let me know.

    thanks

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: MAX_JOIN_SIZE rows email customers not working

    I'm assuming that the SQL instructions your hosting company have provided are correct. If so, then you could put the following into a new file as shown:

    Put the file here:
    /your-renamed-admin/includes/functions/extra_functions/my_custom_big_selects_fix.php
    ("your-renamed-admin" refers to whatever you've renamed your /admin/ folder to)
    Code:
    <?php
    // added because hosting company is flagging errors on big selects
    $db->Execute("SET SQL_BIG_SELECTS=1");
    Note that I used the "extra_functions" folder, instead of the "extra_configures" folder I'd suggested earlier, due to a chicken/egg situation that would occur.

    ALSO NOTE: THIS IS JUST A BANDAGE, and does NOT really fix the true root cause, which I suspect is damaged data as described earlier.
    .

    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. Replies: 6
    Last Post: 23 Feb 2010, 02:53 PM
  2. email from contact us page showing my email not customers
    By tanik in forum General Questions
    Replies: 3
    Last Post: 22 Jun 2008, 12:08 AM
  3. I cannot email customers and new customers can not regester
    By duquecigars in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Apr 2008, 02:18 AM
  4. Replies: 3
    Last Post: 28 Mar 2007, 02:39 AM
  5. Customers Login not working in Firefox
    By fbzencart in forum General Questions
    Replies: 2
    Last Post: 13 Oct 2006, 05:12 PM

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