Add query function to php files to query data