Jump to content

[SOLVED] Time Comparison against minutes


SirChick

Recommended Posts

<?php
$sql = "SELECT TIME_FORMAT( TIMEDIFF( NOW( ) , `yourfield` ) , '%i' ) AS difference FROM `yourtable`";
$result = mysql_query($sql)or die(mysql_error());
$difference = mysql_result($result,0);
// or ,if you are selecting other fields as well: $difference = mysql_result($result,0,'difference');
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.