Code Giving me Trouble:
foreach($result as $row)
{
echo "<div class='listing'>";
print $row['uUName'] . '</strong><br />' .
'<strong>' . $row['listTitle'] . '</strong><br />' .
$arr = explode(':', $row['LISTDIFF']);
echo "$arr[0] minutes, $arr[1] seconds";
echo "</div>";
}
This outputs: Array minutes, seconds . Why is the array empty?
Do the date calculations in MySQL:
which returns the difference as a string in the format
hh:mm:ss.ssss, which you can then massage in PHP to add the ‘minutes’ and ‘seconds’ text.