The code passes result of a PHP SQL query through Java script to a App inventor application running on a phone. It uses a special App Inventor Jave script feature called window.AppInventor.getWebViewString(), which allows App Inventor apps to communicate with the WebViewer component's internal processing of javascript.
Call this SQL query using syntax: https://sedwano.com/THPL-appinventor.php?sensor=sensor2001
Will try to get info from: sensor2001
Connected to SQL for {temp, humidity, atm pres, lux} from sensor2001. Running [SELECT temp, humid, pres, lux, batt, date, decHrs FROM sensor2001 WHERE id = (SELECT max(id) from sensor2001)]csv: id,temp,humid;132280,24.21,52.6338;132268,24.95,52.4795;132256,25.67,52.8301;132244,24.59,56.1094;132223,23.31,64.5557;
Starting JAVA.
Allocated variables from SQL to AppInventor via PHP and Javascript