Storing Date in mysql
| From: | Michael Gale | Date: | Thu, 08 Jul 2004 16:44:45 +0000 |
| Subject: | Storing Date in mysql | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35148@lists.php.net to get a copy of this message | ||
Hello,
I need to store the date of record / entry in the mysql database, so I have the following table
create statement:
CREATE TABLE
token_table (
token_id int(11) NOT NULL auto_increment,
token_utuser_id int(11) NOT NULL default '0',
token_name varchar(100) NOT NULL default '',
token_date varchar(100) NOT NULL default '',
token_user_id varchar(100) default '',
token_ticket_id varchar(100) default '',
token_data varchar(100) default '',
PRIMARY KEY (token_id),
KEY tokencheck (token_utuser_id,token_name)
) TYPE=MyISAM;
So in the token_date field I am storing the date in the following format from PHP:
date("d/m/Y") which creates the following entry "05/07/2004" (example).
I would like to know fro the list is ... is this the best way to store the date ? Would this be easy
to select against ?
Michael.