Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,883
    Plugin Contributions
    96

    Default custom mySQL query returns incorrect results?

    Running ZC 1.3.9c with many mods. I've been doing local development using XAMPP (PHP v5.2.9, mySQL v5.0.67-community) running on my Windows 7 machine and recently took the plunge to migrate up to my server which runs Linux 2.6.28.8-20100125a-iscsi-ntacker-fasync-mremap-grsec (PHP v5.2.13, mySQL v5.0.81-log).

    I've added some fields to the order table and the following query, which works fine in a local host environment and also returns the correct results when pasted into the phpMyAdmin for my served-store's database, doesn't return the correct results from my store (only returns the last result of 8):

    SELECT o.check_in_date, o.number_of_days FROM orders o WHERE o.check_in_date >= NOW() OR o.check_out_date >= NOW() ORDER BY o.check_in_date

    I've tried changing the SQL cache method to 'none' from 'file', but that doesn't seem to make a difference.

    Does anyone have any ideas?

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,883
    Plugin Contributions
    96

    Default Re: custom mySQL query returns incorrect results?

    Arggh! The problem was not in the sql query/return, but in a difference between PHP 5.2.9 and 5.2.13 default handling of the array_unique function.

    For PHP 5.2.9 (just my luck), the default sort order was SORT_REGULAR (which works for me); for all other versions, the sort order is SORT_STRINGS (which doesn't).

 

 

Similar Threads

  1. Replies: 9
    Last Post: 12 Jul 2023, 12:26 AM
  2. Replies: 7
    Last Post: 12 Dec 2015, 12:05 AM
  3. v152 Query returns no results if an id value is selected
    By eComEvo in forum General Questions
    Replies: 3
    Last Post: 12 May 2015, 03:07 AM
  4. Replies: 2
    Last Post: 3 Dec 2014, 12:19 AM

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