[PHP-DB] Re: "COUNT() returns 0 if there were no matching rows." .... really?!

2009-08-06 Thread Ben Dunlap
> Here's an example (snip) from a var_dump of that $BuildPerUniqueDateArray: > (note that the 'aweber_7solar_aw' table does NOT have a record for the > date '2009-07-28', so I would expect to see that "1" to be a "0" there.) If a table doesn't have a record for a given date, I wouldn't expect to s

Re: [PHP-DB] newbie: how to return one iteration *per unique date(DAY!)* in a timestamp column?

2009-08-05 Thread Ben Dunlap
>> Just one other tiny point of style here: having given the expression >> date(solarAWDateTime) the alias uniqueDate, you should probably use >> that alias to refer to the same thing elsewhere in your query, such as >> in the GROUP BY column. So: [8<] > That's a mysqlism :( It's not portable to o

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-05 Thread Ben Dunlap
> except that I just added the ORDER BY clause onto each SELECT segment, > and now I get this error: > query failed: Incorrect usage of UNION and ORDER BY > > How can I order the results while still doing the UNION ALLs? You should only need one ORDER BY clause at the end of the whole query:

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-04 Thread Ben Dunlap
> Can someone point me to understand why? I thought that: > SELECT COUNT(*) AS landing_count, date(solarLandingDateTime) AS > solarLandingDate, 't7solar_landingALIAS' AS t7solar_landing FROM > t7solar_landing GROUP BY DATE(solarLandingDateTime) > would, among other thing, assign the number of reco

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-03 Thread Ben Dunlap
> ...which will echo: > "#records in 't7solar_landing' matching the given (iterating) > date (in the 'solarLandingDateTime' column)#records in > 'aw_7solar_confirm' matching the given (iterating) date (in the > 'solarAwConfDateTime' column)#records in 'aw_7solar_aw' > matching the given (iterati

Re: [PHP-DB] newbie: how to return one iteration *per unique date (DAY!)* in a timestamp column?

2009-08-03 Thread Ben Dunlap
Govinda wrote: > .. so my thought is to want to do nested query(ies), where: > *within* the while loop of the first recordset (which is now > successfully returning just rows with unique dates), I do other > query(ies) which will (in their own code block) find all rows of the > date we are iterat