Update query.php

Add if statement to query Data
Merge pull request #3 from selfservice0/patch-2

Update query.php