EchoFool Posted April 19, 2010 Share Posted April 19, 2010 I have a query which checks a timestamp to "NOW()" but it returns nothing.. i echo it and i get nothing , yet with error reporting on it doesn't give me undefined error :S This is what i got: LastAction - 0000-00-00 00:00:00 -Timestamp format SELECT *, TIMESTAMPDIFF(MINUTE,'NOW()','LastAction') AS MinutesAgo FROM ".tablename().".user_data WHERE UserID='$UserID' Then i echo it later on : $row = mysql_fetch_assoc($SELECT); Echo 'Minutes ago: '.$row['MinutesAgo'];Echo '<br>'; Echo 'Username: '.$row['Username']; Echo '<br>'; The return gives: Minutes ago: Username: Username1 Any idea why this is happening? Link to comment https://forums.phpfreaks.com/topic/199048-query-not-returning-value/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 19, 2010 Share Posted April 19, 2010 Both NOW() and LastAction are not strings. Why are they enclosed in single-quotes in the query? Link to comment https://forums.phpfreaks.com/topic/199048-query-not-returning-value/#findComment-1044806 Share on other sites More sharing options...
EchoFool Posted April 19, 2010 Author Share Posted April 19, 2010 I was given the query from a user on phpfreaks a while ago - so i assumed that was how they are typed ... Link to comment https://forums.phpfreaks.com/topic/199048-query-not-returning-value/#findComment-1044835 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.