PHP script to output result of a MySQL query into JSON

Job ID: 32074458

Budget: $10 – $30 USD

Explanation of what I want here https://docs.google.com/document/d/1o0bMocvylrQTc-s9_QDjsTbHnDulQ8I4Jh_dTzlb6-I/edit?usp=sharing

Basically you need to join together some MySQL queries, retrieve a token for a URL download and an order number linked to each order ID, sanitise some data and output the result as JSON in a PHP file.

Every order can have arbitrary line items. Each line item has a URL to download artwork from. I need to be able to group them together by order number. Outputting the JSON code which does will allow me to work on that next stage of the process.