These are the inputs an database rows
$current 2012-07-26 15:30:00
1st $row['start'] 2012-07-26 14:00:00
2nd $row['start'] 2012-07-26 17:00:00
When I run the following code with the above current time, I get correctly the "Starts soon" for the 2nd row, but also I get it mistakenly on the 2nd row that it already started.
How do I edit this code to return me the "Starts soon" message only to the rows that will start in the next two hours?
$diff = strtotime($row['start']) - strtotime($current);
if ($diff < 7200) {
echo 'Starts soon';
} else if ($diff <= 0) {
echo 'Started';
} else {
echo 'Starts';
}