Optimized code (just figured out $db->fetch_array already builds an array :P)