I am getting date from database table. in the loop i am trying to change the format of date before it is displayed but it is not working, the results are blank, before i tried to format i get the results of the database table.
Here is the code:
Code: Select all
foreach($results as $row){
$thedate= $row->dateviewed ;
$thedate = date_format($thedate,'d/m/Y H:i:s');
echo "<tr>";
echo "<td>".$row->username."</td>";
echo "<td>".$row->articlename."</td>";
echo "<td>".$thedate."</td>";
echo "</tr>";
}
Code: Select all
echo "<td>".$row->dateviewed."</td>";
Thanks