put entire select statement inside php section
Revert "put entire select statement inside php section"

This reverts commit 6f7bd4de499a64b53f11ffcf280367535181a2e9.
Merge remote-tracking branch 'origin/master'