RE: [PHP] date problem
| From: | John Holmes | Date: | Thu, 06 Jun 2002 10:40:56 +0000 |
| Subject: | RE: [PHP] date problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100919@lists.php.net to get a copy of this message | ||
So what did you get? Did it work? (No. I doubt it...) Don't just post a
"question" like "Here's what I'm doing...fix it"
Anyway, your really wasting your time by not using a date or timestamp
column. If you don't understand why or realize how easy it is to change
it, you've got a lot of learning to do.
The only way you can do it with a char column is to select the entire
database, load it into a PHP array, using strtotime() to (hopefully)
convert "May 29, 2002", etc, into a unix timestamp, and then sort by
that timestamp.
You just make things more difficult with a char column. I hope you don't
have any more queries based on time or date...
---John Holmes...
> -----Original Message-----
> From: andy [mailto:news.letters@gmx.de]
> Sent: Thursday, June 06, 2002 2:02 AM
> To: php-general@lists.php.net; php-db@lists.php.net
> Subject: [PHP] date problem
>
> Hi there,
>
> I would like to count the users out of a mysql db who registered after
a
> certain date.
>
> The column I have in the db is a char and I do not want to change this
> anymore.
> This is how a typical entry looks like: May 29, 2002
>
> This is how I tryed it:
>
> // while '10...' is unix timestamp june 1, 02
> SELECT COUNT(*) AS c
> FROM users_table
> WHERE UNIX_TIMESTAMP( user_regdate ) > '1022882400'
>
> Thanx for any help on that,
>
> andy
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php