CURDATE

I am wondering why:

SELECT * FROM `bible_concordance_usage` WHERE `date_accessed` = CURDATE()

Doesn't work when `date_accessed` is column type "timestamp"

And

What would work?

Ron




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
ron.piggott [ Mo, 16 August 2010 22:25 ] [ ID #2046135 ]

Re: CURDATE

--0016e68db89ae9a95e048df714fc
Content-Type: text/plain; charset=ISO-8859-1

Try:
DATE(date_accessed) = CURDATE().

Have a look at this:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functio ns.html#function_dateto
understand what's happening.

Regards,
Kesavan.

On 17/08/2010 6:26 AM, "Ron Piggott" <ron.piggott [at] actsministries.org> wrote:

I am wondering why:

SELECT * FROM `bible_concordance_usage` WHERE `date_accessed` = CURDATE()

Doesn't work when `date_accessed` is column type "timestamp"

And

What would work?

Ron




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--0016e68db89ae9a95e048df714fc--
Kesavan Rengarajan [ Mo, 16 August 2010 22:57 ] [ ID #2046136 ]

Re: CURDATE

--0016367d5e2c80dcca048df96cc1
Content-Type: text/plain; charset=ISO-8859-1

Hi all,
I have a big question - why on this list raised question about MySQL or any
other database without any relation to PHP? Is it list for solving SQL and
DB problems? When I subscribe to this list I think that this list is about
PHP DB problems. At least problems related to PHP - but not about problems
about MySQL or any other db or their functions ... whats wrong?

2010/8/16 kesavan trichy rengarajan <k7 [at] trk7.com>

> Try:
> DATE(date_accessed) = CURDATE().
>
> Have a look at this:
>
> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functio ns.html#function_dateto
> understand what's happening.
>
> Regards,
> Kesavan.
>
> On 17/08/2010 6:26 AM, "Ron Piggott" <ron.piggott [at] actsministries.org>
> wrote:
>
> I am wondering why:
>
> SELECT * FROM `bible_concordance_usage` WHERE `date_accessed` = CURDATE()
>
> Doesn't work when `date_accessed` is column type "timestamp"
>
> And
>
> What would work?
>
> Ron
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--0016367d5e2c80dcca048df96cc1--
Aleksei Sapunov [ Di, 17 August 2010 01:44 ] [ ID #2046193 ]
PHP » gmane.comp.php.database » CURDATE

Vorheriges Thema: Slashes or no slashes
Nächstes Thema: COUNT() query help