tomtimms Posted May 12, 2010 Share Posted May 12, 2010 I have 2 queries that I would like to somehow condense into one as I don't want to make 2 calls to my database. My 2 queries are. $sql = "SELECT company FROM revenue_company WHERE status = '1'"; $sql2 = "SELECT company FROM revenue_company WHERE status = '2'"; and I just want to get the number of rows returned for each query so I have $row = mysql_num_rows($result); $row2 = mysql_num_rows($result2); There has to be an easier way for me to condence my query into 1 and get the amount of rows returned that either have a status of 1 or a status of 2. Any suggestions would be great. Quote Link to comment https://forums.phpfreaks.com/topic/201436-taking-2-statements-into-1/ 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.