niche Posted October 11, 2010 Share Posted October 11, 2010 is there some way to combine - $result2 = mysql_query("SELECT * FROM plan WHERE curref >= ddecpt AND ddecpt and > 0") or die(mysql_error());and$result = mysql_query("SELECT * FROM plan WHERE DATE(NOW()) BETWEEN DATE(begin) AND DATE(end)") or die(mysql_error());or should I deal with it in mysql_fetch_array using an if statement?Thanks Link to comment Share on other sites More sharing options...
boen_robot Posted October 11, 2010 Share Posted October 11, 2010 You can chain multiple ANDs, and use brackets if needed.I'm not sure what you need, but maybe this will do it: $result = mysql_query("SELECT * FROM plan WHERE (DATE(NOW()) BETWEEN DATE(begin) AND DATE(end)) AND (curref >= ddecpt AND ddecpt and > 0)") or die(mysql_error()); Link to comment Share on other sites More sharing options...
niche Posted October 11, 2010 Author Share Posted October 11, 2010 Thanks boen_robot. That works. I was using an extra WHERE.Thanks Again,Niche Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.