RE: [PHP] Query question
| From: | Richard Lynch | Date: | Mon, 30 Oct 2006 05:04:27 +0000 |
| Subject: | RE: [PHP] Query question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-243863@lists.php.net to get a copy of this message | ||
On Sun, October 29, 2006 2:06 am, Beauford wrote:
> This is how I get the data and I have no control over the actual
> layout of
> the database. So I have to work with what I have.
When you say it's "how you get the data" are they handing you a MySQL
database that is this badly-constructed?
Or are you importing data whose dates are in 'mm/dd/yyyy' format, and
failing to realize that you CAN and SHOULD convert those to date as
part of your import process.
> LOL, I don't know either. The format is - 01/01/2006. When I first did
> it I
> used 7, which should be right, but I ended up getting /2002 /2003,
> etc. So I
> went to 8 and all was well. Beats me.....
Dollars to donuts says your 'date' (which is really a string) has some
leading spaces which is messing up your count...
Of course, after you fix the import process to have an actual DATE in
your DB, this will be a non-issue...
Short-term, you should probably at least trim() the data so that your
offset of 8 is the number you would expect...
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?