gerkintrigg Posted December 17, 2006 Share Posted December 17, 2006 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 More sharing options...
btherl Posted December 18, 2006 Share Posted December 18, 2006 If no output is appearing there are two possibilities1. Your query is invalid.2. Your query is valid, but produces no results. Link to comment https://forums.phpfreaks.com/topic/30959-solved-datediff-problem/#findComment-143308 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.