The child site will need to ask the parent site the following queries:
Query 1:
SELECT advertisement_url, advertisement_image FROM advertisement WHERE advertisement_type = 'banner' ORDER BY RAND() LIMIT 0,2
Query 2:
SELECT advertisement_url, advertisement_image FROM advertisement WHERE advertisement_type = 'sidebar' ORDER BY RAND() LIMIT 0,2
Query 3:
SELECT * FROM site WHERE site_name = ? AND site_url = ? AND site_token = ? AND site_active = 1
All information is held in parent database. What I want to happen for Query 1 is to get an array of the advertisements so then I can grab them and loop through them to display the ads. For query 3 I need either a true or false value. If it's true then the site runs and if not then an error message displays.