I guess it would depend if you need to access those variables globally or just locally to the function that requires them ?
Depending on the situation you could always do both ? Store the variables you know need global access at the top before your conditionals, and then store the local ones inside the function.
Perhaps someone with a better insight will step in and clarify it for you.
As a side note, I wouldn't run any queries to the DB that weren't entirely necessary. I should imagine it's much better to invoke them on demand.
- Mike
__________________