Jump to content

[SOLVED] DATEDIFF Problem


gerkintrigg

Recommended Posts

I'm using the following code to get the number of days remaining (limited to 30) for a record before it expires.

[code]$s=mysql_query("SELECT DATEDIFF((expire+30), NOW()) AS time_in_db
FROM pokes
WHERE `poker` =".$row['id']."
&& `poked`=".$_SESSION['my_id']."
ORDER BY expire ASC");
$nod=mysql_fetch_array($s);
echo 'time = '.$nod['time_in_db'];
$no_of_days=$nod+30;[/code]
but it's not working.

Any ideas?
No errors are appearing, just "time=" and then nothing.

Thanks in advance
Link to comment
https://forums.phpfreaks.com/topic/30959-solved-datediff-problem/
Share on other sites

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.