php - how to display the dob dd mm yyyy values from database to let the users edit it -
i don't know if asked question or not..
well having form have dob field , dd mm yyyy taken users 3 textfields.. , took values , inserted db dis..
$dob=$_post('yyyy')+"-"+$_post('mm')+"-"+$_post('dd'); (insert bla bla bla) dob <input type="text" name="dd"> <input type="text" name="mm"> <input type="text" name="yyyy">
now having form i'm letting users edit info including dob , update those..
now want show current dob in editinfo page 3 text fields same , want display user's dob date in dd, dob month in mm,and dob year in yyyy field coming database. return value in text field like
<input type="text' value="<?php echo $name;?>
i want same..but can't return value of $dob because surely return in yyyy-mm-dd.i want each value displayed in separate fields mentioned..
any appreciated.. thank you..!!!
you can use explode function each values. know returning result mysql in 'yyyy-mm-dd' format .
for example '2015-04-01' value .
<?php $date = '2015-04-01'; $splited_date_array = explode('-',$date); $year = $splited_date_array[0]; $month = $splited_date_array[1]; $day = $splited_date_array[2]; ?>
Comments
Post a Comment