DATE vs INT
| From: | Russ | Date: | Wed, 03 Jul 2002 04:55:31 +0000 |
| Subject: | DATE vs INT | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20287@lists.php.net to get a copy of this message | ||
Hi all:
Our company uses for reasons of experience, an INT(10) field for storing
dates in a MySQL DB. ((We just DO OK! ;-))
However I it is because the date isn't stored as a DATE or DATETIME
(etc) that I can't do an accurate ORDER BY <name_of_date_field> - as
MySQL doesn't recognise the field's content as a valid date simply an
integer (that we modify for display using PHP)
Does anyone know of a way (kludge or otherwise) I may be able to perform
such an ORDER BY, so that the dates in an HTML display table column are
ordered AS dates while using an INT field format??
Cheers folks.
Russ
Mr Russ Michell
Web Applications Developer
Itomic.com
Email: russ@itomic.com
Tel: +61 (0)8 9321 3844
Fax: +61 (0)8 6210 1364
Post: PO Box 228, Innaloo, WA 6918, Australia
Street: Suite 24, 158 William St, Perth, WA 6000, Australia
"No proof of existence is not proof of non-existence."
(Physicist: Stanton T. Friedman on Debunking Ufology)