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",$date_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?
Expand|Select|Wrap|Line Numbers
- SELECT DATE_FORMAT(date_time,'%Y-%m-%d %H:%i:%s'),
- FROM project WHERE project.ctrl_no = '$proj_id'