Exploring PHP—arrays and SQL