Welcome Guest, Not a member yet? Register   Sign In
Get the value
#1

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
Reply


Messages In This Thread
Get the value - by Fraps900 - 11-20-2016, 01:58 PM
RE: Get the value - by Wouter60 - 11-21-2016, 11:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB