Re: GROUP BY MONTH(DateBilled) misses an entry consistently

From: Date: Sun, 13 Jan 2002 02:33:27 +0000
Subject: Re: GROUP BY MONTH(DateBilled) misses an entry consistently
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-15708@lists.php.net to get a copy of this message
Howdy DL & Jason, I didn't see your response Jason until DL cc'd me this note. Sorry I didn't check back to follow-up on the newsgroup.. I thought I had the answer (well I had one, but not quite the right one).. Dl Neil wrote:
Sorry, I haven't been keeping close track of the list - fortunately you have solved your problem.
Hey, you've responded better & faster than many support@IAmAPayingCustomer.com groups that I've delt with.
However you do not appear to have taken on-board Jason's comment. His/our concern would be that there are two mechanisms for extracting the results of the query from the MySQL resultset: DBfetch_array() which is presumably a local wrapper, and (later in the code) a 'native' call to mysql_fetch_array(). These two were both present before the switch from WHILE to DO...WHILE. Well done for spotting the error!
I had missed the wrapper when I was playing with the code.. I use a number of different PHP/MySQL interfaces and it is always a bit of a jump to remember how program X connects with MySQL (as the wrappers are all different)..
I too have built myself 'wrapper' routines to handle db queries and both the subsequent extraction and loop control. They looks like: Fetch( $dbConnection, $NumRows, etc, $ResultSet ) while ( TheresAnotherRowToScan( $RowList, $ResultSet ) ) { etc [in fact, I stole the arg lists from the routines themselves - the language used in the calling routines is much more topical/self-documenting]
I haven't and don't plan to develop my own wrappers. I'd much rather use ones like those developed for phplib..
=Thus there is no need for the 'double' resultset extractions...
Yes.. Not a good idea at the best of times.. Mike -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Supporting progressive organizations in online campaigns and tools. Feature: Women's Learning Partnership http://learningpartnership.org Truth is that which confirms what we already believe. Northrop Frye

« previous php.db (#15708) next »