I'm running some sql code from my PHP site/game to find the players friends and enemies online. Both are pulling data from the same tables.
// friends online
SELECT COUNT(*) FROM contacts c
INNER JOIN online o ON o.playerID = c.playerID
WHERE c.myID=".$id." AND c.type='friends'
// enemies online
SELECT COUNT(*) FROM contacts c
INNER JOIN online o ON o.playerID = c.playerID
WHERE c.myID=".$id." AND c.type='enemies'
Is there a way to combine these together and get two counts at the end? Would that be faster?
SELECT. And, with your rep, you should know to tag the database you are using.