Hello,
I want to to make it possible for users to edit data stores in DB.
When data is extracted from the DB it is displayed in form input fields, where ic can be edited
Here is the code for insertind the extracted data into input fields:
<?php foreach ($positions as $pkey=>$pval)
{
echo '<tr>
<td><input type="text" name-"id[]" value ='.$pval['id'].'></td>
<td><input type="text" name-"ticket[]" value ='.$pval['ticket'].'></td>
<td><input type="text" name-"o_time[]" value ='.$pval['o_time'].'></td>
<td><input type="text" name-"type[]" value ='.$pval['type'].'></td>
<td><input type="text" name-"size[]" value ='.$pval['size'].'></td>
<td><input type="text" name-"item[]" value ='.$pval['item'].'></td>
<td><input type="text" name-"o_price[]" value ='.$pval['o_price'].'></td>
<td><input type="text" name-"s_l[]" value ='.$pval['s_l'].'></td>
<td><input type="text" name-"t_p[]" value ='.$pval['t_p'].'></td>
<td><input type="text" name-"c_time[]" value ='.$pval['c_time'].'></td>
<td><input type="text" name-"c_price[]" value ='.$pval['c_price'].'></td>
<td><input type="text" name-"profit[]" value ='.$pval['profit'].'></td>
<td><input type="checkbox" name="update[]"></td>
<td><input type="checkbox" name="delete[]"></td>
</tr>';
}
?>
In this code configuration , o_time looks like this: 2017-07-31
The time of the timestamp disappears
When I change the table cell code to
<td>'.$pval['o_time'].'</td>
the input value is 2017-07-31 08:24:11
Why does it happen?
How do I ensure that the value in the input field will be a timestamp ?