usually, when i have questions regarding my DB systems, i just google, and i always find this forum very helpful, so i decided to join this forum and ask this question i coulndt find on the net, 'coz i think you guys know a lot about this:
I have this Datetime field in my mysql DB, which i queried with the SELECT command. now in my page, i have this input field for datetime. in this input box, i would like to place the value in my MYSQL DB as a default value, but when i tried to do this:
[PHP]
<input type="text" name="date_time " value =<? printf("%s",$da te_time); ?> >
[/PHP]
it only outputs the date, and not include the time.
i tried to output what was in the variable before the input box and what i got was this:
2008-04-02 10:30:00
but in the box, it only showed
2008-04-02.
here's the select statement and php code i used at the top of the page.. what am i doing wrong?
[PHP]$date_time = $row[0];[/PHP]
I have this Datetime field in my mysql DB, which i queried with the SELECT command. now in my page, i have this input field for datetime. in this input box, i would like to place the value in my MYSQL DB as a default value, but when i tried to do this:
[PHP]
<input type="text" name="date_time " value =<? printf("%s",$da te_time); ?> >
[/PHP]
it only outputs the date, and not include the time.
i tried to output what was in the variable before the input box and what i got was this:
2008-04-02 10:30:00
but in the box, it only showed
2008-04-02.
here's the select statement and php code i used at the top of the page.. what am i doing wrong?
Code:
SELECT DATE_FORMAT(date_time,'%Y-%m-%d %H:%i:%s'), FROM project WHERE project.ctrl_no = '$proj_id'
Comment