jamesmu wrote:I always assumed that the less sql querys the better, but i guess its less actual data coming from the database so thats better?
Yes, reducing the number of SQL statements executed is a good idea, but not at the cost of doing PHP to do the work that the database probably can do better.
In all likelihood you do not need 20 SQL statements (or to execute one SQL statement 20 times with different bindings), but only one.