Re: What's wrong with this date ?

From: Date: Sun, 18 Nov 2001 07:54:51 +0000
Subject: Re: What's wrong with this date ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75026@lists.php.net to get a copy of this message
Do yourself a favor and read the mysql manual. It explicitly answers your questions and many more you are likely to have. Furthermore, there is a searchable manual online at mysql.com that makes it rather easy to find answers about mysql. To get you started, here is a link to a description of all of the column types includeing date, varchar and char. Good Luck Fred Trongduc <trongduc@tlnet.com.vn> wrote in message news:000201c16ff6$ff36e470$1b0b10ac@d... > hi there, > I try to save a record (in the "date" type in MySQL) from the <INPUT > type=text> by : > > $query = "INSERT INTO $table VALUES ($post_id, 0, '$topic', '$uname', > '$body', $date, '$newdate', 0) "; > > But it couldn't work (I used $date or '$date' on above, but they got the > same results) ! > > It showed me the wrong value, as : 1970-0-0 (always this, although I try to > input different values in the text box with the date format is YYYY-MM-DD) > I don't understand the way MySQL saves my date field in his data (is it > YYYY-MM-DD ?) > > Can anyone help me in this case ? > Thanks much... > > ps : I used the $date field in "varchar(20) type" instead. BWT, what's > different beween the Varchar(length) type with the Char(length) type ? >

« previous php.general (#75026) next »