Forum Moderators: coopster
1 query = 1 database connection.
2 queries = 2 database connections.
Even if you keep the connection open and close it once you still have to tax that connection with 2 queries instead of 1. Plus you have to create 2 variables in memory to hold both outputs instead of 1.
In my eyes 1 is better. If you only need 3 columns then write 1 query that returns 3 columns, and when you need 16 columns write 1 query that returns 16 columns.
[edited by: Demaestro at 2:38 pm (utc) on Mar. 24, 2008]
However the only way to be certain would be to test on your system. As each set of servers will be slightly different.
[edited by: PHP_Chimp at 9:30 am (utc) on Mar. 26, 2008]