Thanks, this is very helpful. What was least clear for me is whether, if I have to loop through the array anyway, I should loop through the select and in the same loop print the values, whether I should wait until I've gotten the values and then print them all, or whether there was something like execute_array that would handle them all at the same time. I believe I read that execute_array is not for SELECT statements, though, even though I can't figure out where I'd have read that.