almightyegg Posted April 14, 2009 Share Posted April 14, 2009 I have this code if($gauge == TRUE){ $timestamp = date("Y-m-d H:i:s"); $d2 = strtotime($timestamp); $info .= " and strtotime(`gauge`) > '$d2'"; } $info becomes this big long string and is like this: $info = "SELECT * FROM users WHERE$info"; $sel = mysql_query("$info") or die(mysql_error()); Problem is, I'm not sure how to do the strtotime() to the table variable. it's reading it a a column heading: FUNCTION lordofth_game.strtotime does not exist Any help on how to get it to work would be greatly received Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 14, 2009 Share Posted April 14, 2009 MySQL doesn't have STRTOTIME function. What type is the `gauge` field? Quote Link to comment Share on other sites More sharing options...
almightyegg Posted April 14, 2009 Author Share Posted April 14, 2009 timestamp Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 14, 2009 Share Posted April 14, 2009 Then this should work if($gauge == TRUE){ $info .= " and `gauge` > NOW()"; } Quote Link to comment Share on other sites More sharing options...
almightyegg Posted April 14, 2009 Author Share Posted April 14, 2009 That was an epic fail by me :S cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.