In addition:
If you need to use a big volume of data SQL usage preferrable. "SELECT" usually much faster than "for()". BUT is you has a finite list of items that will never be changed(such as list of states) it's faster to store it in PHP array than make separated SQL table and add it to all queries.