Set of mysql queries in a database management software. Querying and updating an SQL database, PHP script for updating