SELECT c.enddate FROM cohort c ORDER BY c.enddate DESC LIMIT 1
I have a sql query above, it works in database, the result select a date like: '2018-07-18'
I try to use while loop with mysqli_fetch_row in php to fetch this date, but the result will only fetch: 2018
How can I get the whole date?
if ($runquery = $conn->query($result_validation))
{
//get the enddate from the last cohort
while ($row = mysqli_fetch_row($runquery))
{
$lastDate = $row[0];
}
}
$row[0] only display first number: 2018.