Re: Storing Date in mysql

From: Date: Thu, 08 Jul 2004 17:37:37 +0000
Subject: Re: Storing Date in mysql
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-35152@lists.php.net to get a copy of this message
Thanks ... I can't believe I missed that in the docs ... now I feel like knob. Michael. On Thu, 8 Jul 2004 14:17:38 -0300 "Pablo M. Rivas" <pmrivas01@yahoo.com.ar> wrote: > Hello Michael, > token_date must be a DATE FIELD... > > http://dev.mysql.com/doc/mysql/en/Column_types.html > > > MG> Hello, > > MG> I need to store the date of record / entry in the mysql database, so I have the > MG> following table create > MG> statement: > > MG> CREATE TABLE token_table ( > MG> token_id int(11) NOT NULL auto_increment, > MG> token_utuser_id int(11) NOT NULL default > MG> '0', > MG> token_name varchar(100) NOT NULL default '', > MG> token_date varchar(100) NOT NULL default '', > MG> token_user_id varchar(100) default '', > MG> token_ticket_id varchar(100) default '', > MG> token_data varchar(100) default '', > MG> PRIMARY KEY (token_id), > MG> KEY tokencheck > MG> (token_utuser_id,token_name) > MG> ) TYPE=MyISAM; > > MG> So in the token_date field I am storing the date in the following format from PHP: > > MG> date("d/m/Y") which creates the following entry "05/07/2004" > MG> (example). > > MG> I would like to know fro the list is ... is this the best way to store the date ? Would > MG> this be easy to select > MG> against ? > > MG> Michael. > > > > > -- > Best regards, > Pablo > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- Michael Gale Network Administrator Utilitran Corporation

« previous php.db (#35152) next »