This piece of PHP code was written for a project in which an iOS application communicates with a MYSQL database by way of a web services script.