Hi guys, please tell me how to get the value form these below dates:
Code:
$sql = "SELECT start_date, deadline FROM projects WHERE id =7";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
[b] echo $row["start_date"];[/b]
[b] echo $row["deadline"];[/b]
}
}
to this:
[code]
<?php
$start = '$start_date';
$end = '$deadline';
$diff = (strtotime($end)- strtotime($start))/24/3600;
echo $diff;
?>
Using echo or something?
Thanks for help