Hi friend am trying to retreive the dates from mysql column named 'date' which has date and time. I want to retreive only dates not times. I want retreive only dates which are not duplicates..
Here is sample data of mysql with column date..
03/07/2017 03:37:12pm
03/07/2017 10:38:12pm
04/07/2017 10:38:12pm
04/07/2017 2:38:12pm
wanted out put as
03/07/2017
04/07/2017
Here is my php code
<?php
$sql = "SELECT DISTINCT date('d/m/Y,date) FROM video_data";
echo $sql;
$result = mysqli_query($connection, $sql);
echo $result;
while ($row = mysqli_fetch_assoc($result)) {
$id = $row['id'];
$date = $row['date'];
$date = date('Y-m-d', strtotime($date));
echo "<tr>";
echo "<td>$date</td>";
echo "</tr>";
}
?>
Am unable to print dates using php