As a general rule it is best to use one query opposed to two because each query has overhead for execution. Even if one query takes longer than either two it will still run faster than the two combined. It's also better practice, you want your database to do as much of the data processing as possible opposed to having PHP play a part in it. Also, don't use SELECT *, it takes longer to run and leaves ambiguity in your code. Do something like