shane18 Posted September 21, 2009 Share Posted September 21, 2009 How can you put a function into a SQL line correctly? $sql = "SELECT e_mails FROM mail_useage WHERE date=date("Y-m-d", TIME() - 18000)"; Would the code above work? If not, why not? Link to comment https://forums.phpfreaks.com/topic/175029-solved-mysql-query-functions/ Share on other sites More sharing options...
alexdemers Posted September 21, 2009 Share Posted September 21, 2009 How can you put a function into a SQL line correctly? $sql = "SELECT e_mails FROM mail_useage WHERE date=date("Y-m-d", TIME() - 18000)"; Would the code above work? If not, why not? Use concatenation: $sql = "SELECT e_mails FROM mail_useage WHERE date=".(date("Y-m-d", TIME() - 18000)); Link to comment https://forums.phpfreaks.com/topic/175029-solved-mysql-query-functions/#findComment-922438 Share on other sites More sharing options...
shane18 Posted September 21, 2009 Author Share Posted September 21, 2009 What if I do: $sql = mysql_query("SELECT e_mails FROM mail_useage WHERE date=date("Y-m-d", TIME() - 18000)"); Now how do I do it? Link to comment https://forums.phpfreaks.com/topic/175029-solved-mysql-query-functions/#findComment-922441 Share on other sites More sharing options...
shane18 Posted September 21, 2009 Author Share Posted September 21, 2009 hello... is what i asked above possible? Link to comment https://forums.phpfreaks.com/topic/175029-solved-mysql-query-functions/#findComment-922459 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.