Results 1 to 10 of 18

Hybrid View

  1. #1
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Newsletter error TABLE_ORDERS doesn't exist

    Hi

    We have a cart (version 1.5.1, PHP Version: 5.4.34) which has an error when trying to send newsletters. The debug file shows this error


    PHP Fatal error: 1146:Table 'user_zencart.TABLE_ORDERS' doesn't exist :: select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from zen_customers c,

    TABLE_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 in /home/user/public_html/shop/includes/classes/db/mysql/query_factory.php on line 120

    Not sure what to make of this one. The orders table does exist in the database. Could someone please point me in the right direction?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Newsletter error TABLE_ORDERS doesn't exist

    May seem like a step backwards, but there is some code that could be added to your store which will identify where that query is being run that is wrongly formatted. For some reason it is trying to find the actual text that is to be substituted by the table information.

    Lat9 created it, the plugin has the name mydebug in it... I think... Basically it tells you which file sent the query.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Newsletter error TABLE_ORDERS doesn't exist

    Thank you mc12345678

    I installed the module you mentioned. Below are the new debug files. I checked all files mentioned to be sure they are 1.5.1 original. So far I am stumped. This cart was upgraded from 1.3.7 in 2012. I'm waiting to hear back as to how long this problem has been going on and what possible work or changes had been done just prior.


    [11-Dec-2014 21:49:55 America/Los_Angeles] #1 trigger_error() called at [/home/user/public_html/cart/includes/classes/db/mysql/query_factory.php:120]
    #2 queryFactory->show_error() called at [/home/user/public_html/cart/includes/classes/db/mysql/query_factory.php:105]
    #3 queryFactory->set_error() called at [/home/user/public_html/cart/includes/classes/db/mysql/query_factory.php:227]
    #4 queryFactory->Execute() called at [/home/user/public_html/cart/includes/functions/audience.php:42]
    #5 get_audiences_list() called at [/home/user/public_html/cart/user-admin/email_export.php:276]

    [11-Dec-2014 21:49:55 America/Los_Angeles] PHP Fatal error: 1146:Table 'user_zencart.TABLE_ORDERS' doesn't exist :: select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from zen_customers c,

    TABLE_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 in /home/user/public_html/cart/includes/classes/db/mysql/query_factory.php on line 120




    [11-Dec-2014 21:49:38 America/Los_Angeles] #1 trigger_error() called at [/home/user/public_html/cart/includes/classes/db/mysql/query_factory.php:120]
    #2 queryFactory->show_error() called at [/home/user/public_html/cart/includes/classes/db/mysql/query_factory.php:105]
    #3 queryFactory->set_error() called at [/home/user/public_html/cart/includes/classes/db/mysql/query_factory.php:227]
    #4 queryFactory->Execute() called at [/home/user/public_html/cart/includes/functions/audience.php:42]
    #5 get_audiences_list() called at [/home/user/public_html/cart/user-admin/includes/modules/newsletters/newsletter.php:32]
    #6 newsletter->choose_audience() called at [/home/user/public_html/cart/user-admin/newsletters.php:308]

    [11-Dec-2014 21:49:38 America/Los_Angeles] PHP Fatal error: 1146:Table 'user_zencart.TABLE_ORDERS' doesn't exist :: select o.date_purchased, c.customers_email_address, c.customers_lastname, c.customers_firstname from zen_customers c,

    TABLE_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 in /home/user/public_html/cart/includes/classes/db/mysql/query_factory.php on line 120

  4. #4
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Newsletter error TABLE_ORDERS doesn't exist

    In the future, code chunks like that should be posted inside of code tags that are created by selecting the hashtag/pound sign (#) above.

    That said, check before line 42 of the following file:
    Code:
    cart/includes/functions/audience.php:42]
    And look at the sql statement for errors or post here. It may be something that has carried over that was to be deleted or didn't get updated properly/fully.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: Newsletter error TABLE_ORDERS doesn't exist

    This is the chunk of code. I've noted which line is #42. Thanks for taking some time with this.


    Code:
     reset($queries_list);
      while (!$queries_list->EOF) {
        // if requested, show recordcounts at end of descriptions of each entry
        // This could slow things down considerably, so use sparingly !!!!
        if ($display_count=='true' || $display_count ==true ) {  // if it's literal 'true' or logical true
        $count_array = $db->Execute(parsed_query_string($queries_list->fields['query_string']) );  //---------- line 42
        $count = $count_array->RecordCount();
        }

  6. #6
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Newsletter error TABLE_ORDERS doesn't exist

    Quote Originally Posted by buildingblocks View Post
    This is the chunk of code. I've noted which line is #42. Thanks for taking some time with this.


    Code:
     reset($queries_list);
      while (!$queries_list->EOF) {
        // if requested, show recordcounts at end of descriptions of each entry
        // This could slow things down considerably, so use sparingly !!!!
        if ($display_count=='true' || $display_count ==true ) {  // if it's literal 'true' or logical true
        $count_array = $db->Execute(parsed_query_string($queries_list->fields['query_string']) );  //---------- line 42
        $count = $count_array->RecordCount();
        }
    Based on that, need to work backwards to what is assigned to:

    Code:
    parsed_query_string($queries_list->fields['query_string'])
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Database Error: 'ezpages_content' doesn't exist
    By inteltronics in forum Upgrading to 1.5.x
    Replies: 9
    Last Post: 14 Oct 2012, 02:29 PM
  2. error: 1146 MODULE_SHIPPING_ZONES_COUNTRIES' doesn't exist
    By ididukaan in forum Addon Payment Modules
    Replies: 1
    Last Post: 11 Dec 2011, 11:16 PM
  3. Newsletter Unsubscribe Email Doesn't Exist
    By imacamper in forum General Questions
    Replies: 1
    Last Post: 30 Mar 2010, 08:30 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