Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Query Factory / Query Builder Fails

    Hi All,
    Running ZC 1.5.5e on php 7.0. In preparing to send a newsletter using the "dormant customers" query

    Code:
    select c.customers_email_address, c.customers_lastname, c.customers_firstname from TABLE_CUSTOMERS c, TABLE_ORDERS o where c.customers_newsletter = '1' AND c.customers_id = o.customers_id and o.date_purchased > subdate(now(),INTERVAL 3 MONTH) GROUP BY c.customers_email_address, c.customers_lastname, c.customers_firstname order by c.customers_lastname, c.customers_firstname ASC
    I get the following debug log

    Code:
    [04-Dec-2018 14:14:19 America/New_York] Request URI: /admin/newsletters.php?page=1&nID=40&action=confirm, IP address: 24.154.59.125
    #1  mysqli_query() called at [/home/acctss/public_html/includes/classes/db/mysql/query_factory.php:45]
    #2  queryFactory->query() called at [/home/acctss/public_html/includes/classes/db/mysql/query_factory.php:257]
    #3  queryFactory->Execute() called at [/home/acctss/public_html/admin/includes/modules/newsletters/newsletter.php:52]
    #4  newsletter->confirm() called at [/home/acctss/public_html/admin/newsletters.php:324]
    
    [04-Dec-2018 14:14:19 America/New_York] PHP Warning:  mysqli_query(): Empty query in /home/acctss/public_html/includes/classes/db/mysql/query_factory.php on line 45
    [04-Dec-2018 14:14:19 America/New_York] Request URI: /admin/newsletters.php?page=1&nID=40&action=confirm, IP address: 24.154.59.125
    #1  trigger_error() called at [/home/acctss/public_html/includes/classes/db/mysql/query_factory.php:167]
    #2  queryFactory->show_error() called at [/home/acctss/public_html/includes/classes/db/mysql/query_factory.php:139]
    #3  queryFactory->set_error() called at [/home/acctss/public_html/includes/classes/db/mysql/query_factory.php:266]
    #4  queryFactory->Execute() called at [/home/acctss/public_html/admin/includes/modules/newsletters/newsletter.php:52]
    #5  newsletter->confirm() called at [/home/acctss/public_html/admin/newsletters.php:324]
    
    [04-Dec-2018 14:14:19 America/New_York] PHP Fatal error:  0: ::  ==> (as called by) /home/acctss/public_html/admin/includes/modules/newsletters/newsletter.php on line 52 <== in /home/acctss/public_html/includes/classes/db/mysql/query_factory.php on line 167
    All other groups seem to be working without issue. Limiting to 10 records, changing to order DESC doesn't help. I get a white page with warning an error occurred etc...

    Thank You,
    John

  2. #2
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    806
    Plugin Contributions
    0

    Default Re: Query Factory / Query Builder Fails

    The problem was in the query_name. Dormant Customers (>3months) (Subscribers)
    Removed the brackets and greater than and it works just fine. strange...

    Thank you John

 

 

Similar Threads

  1. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  2. v151 [Fixed 1.6.0]Query Factory
    By lhungil in forum Bug Reports
    Replies: 2
    Last Post: 9 Oct 2012, 10:12 PM
  3. query factory error
    By ethanolic in forum General Questions
    Replies: 12
    Last Post: 20 Sep 2007, 02:40 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