Write a single page PHP application that implements all the CRUD operations on a database named "IOT" that contains a table named "TEMPERATURE" that has the following structure:
CREATE TABLE TEMPERATURE (
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
temperature DOUBLE NOT NULL,
longitude DOUBLE NOT NULL,
latitude DOUBLE NOT NULL,
description VARCHAR(50),
measurement_date TIMESTAMP
)
The credentials to connect to the database are as follows: username="root" and password="root"
The following examples illustrate the RESTful CRUD operations that your application should support:
https://localhost/hw1.php?op=insert&temperature=78.34&long=85.2343242&lat=-34.35233&description=Room-A-214&time=20160514201633
https://localhost/hw1.php?op=udate&id=3&temperature=81.34
https://localhost/hw1.php?op=delete&id=7
https://localhost/hw1.php?op=listall
https://localhost/hw1.php?op=getdetails&id=2
https://localhost/hw1.php?op=getlatest
The response of all of these operations must be in JSON format.
Further, the response of this operation https://localhost/hw1.php?op=table must be an HTML page that displays a table of all the recorded temperature readings where the background of the even rows is white and that of the odd rows is blue.