|
Posted by paul814 on 12/24/07 16:23
On Dec 24, 10:59 am, My Pet Programmer <anth...@mypetprogrammer.com>
wrote:
> paul...@excite.com said:
>
> > Well the editorialdate is stored as a VARCHAR and I have to do it that
> > way because of some other things that I am doing...I cant store it as
> > DATE/TIME. But it is populated as:
> > Dec 24, 2007, 8:37 am
> > for example.
>
> Ouch, sorry to hear that. Have you traced back to see what you're
> getting from the DB? Just a print_r on the rows would do ya. That way
> you can narrow down where the problem is. If it's just the query, that's
> pretty simple to resolve in most cases.
>
> ~A!
I dont know how to do the print_r but this is what one of my
editorialdate fields looks like...its a copy and paste right from the
DB:
Dec 24, 2007, 8:37 am
that is exactly what it looks like in the DB.
but in my page I am only looking for the first characters of the
date....so my query is anyhting that looks like this:
Dec 24, 2007,
I don't care about the time at all just the date, that is why I am
doing this:
$today = date("M j, Y,");
echo $today; (this displays like: Dec 24, 2007,)
and then that is why my query looks like this:
$sql = "SELECT * FROM editorial WHERE editorialdate LIKE '$today%' ";
So basically select everything from editorial where the editorialdate
field is like Dec 24, 2007,
Navigation:
[Reply to this message]
|