Jump to content

AND and mysql_query


niche

Recommended Posts

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

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

Thanks boen_robot. That works. I was using an extra WHERE.Thanks Again,Niche

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...