Ritesh
Ritesh

Reputation: 650

how to get date from database to html datepicker

How can I get value of date from database to html datepicker?? following is my html code.

<input type="date" class="m-wrap" value=<?php $result[0]->startdate?> name="date" <?php if(!$is_master_admin){ ?> min="<?php echo date("Y-m-d"); }?>" />

in database datatype of datefield is "date".

Simply i would like to retrieve date from mysql to html5 datepicker

Upvotes: 3

Views: 3857

Answers (1)

Wiram Rathod
Wiram Rathod

Reputation: 1919

 <input type="date" class="m-wrap" value="<?php echo strftime('%Y-%m-%d', strtotime($result[0]->startdate)); ?>" name="date" />

Upvotes: 6

Related Questions