Skip to content Skip to sidebar Skip to footer

Change Mysql Datetime To Php Datetime-local Not Working By Strtotime()

I have mysql table with datatime type and i want it to show in php/html table while($row = mysqli_fetch_assoc($result)) { $time1 = strtotime($row['Request Date']); $myFormatForView

Solution 1:

You have there missing spaces between attributes (id and value) and missing quotes around the value attribute:

<td>  
    <input type='datetime-local'id='txt_dateid_" . $i . "' value='" . $myFormatForView . "' disabled>
</td>

Note: for better reading I've indented input in td and put there optinal spaces around dots ..

Solution 2:

you have mistaken here

<td>  <input type='datetime-local'id='txt_dateid_".$i." 'value=".$myFormatForView."  disabled></td>

replace this line with below one

<td>  <input type='datetime-local'id='txt_dateid_".$i."''value='".$myFormatForView."'  disabled></td>

Solution 3:

Error Spotted you haven't put quotes in value ''. Use this

<td>  <input type='datetime-local'id='txt_dateid_".$i."' value='".$myFormatForView."'  disabled></td>

Hope this helps you

Solution 4:

You have missed the quotes for value attribute. Try this:

<td>  <input type='datetime-local'id='txt_dateid_".$i."' value='".$myFormatForView."'  disabled></td>

Post a Comment for "Change Mysql Datetime To Php Datetime-local Not Working By Strtotime()"