8 if (! $connect) { |
8 if (! $connect) { |
9 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
9 die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
10 } |
10 } |
11 |
11 |
12 // get data and store in a json array |
12 // get data and store in a json array |
13 $query = "SELECT * FROM inventory_water_profiles"; |
13 $query = "SELECT * FROM inventory_water_profiles ORDER BY name"; |
14 if (isset($_GET['insert'])) { |
14 if (isset($_GET['insert'])) { |
15 // INSERT COMMAND |
15 // INSERT COMMAND |
16 $sql = "INSERT INTO `inventory_water_profiles` SET name='" . mysqli_real_escape_string($connect, $_GET['name']); |
16 $sql = "INSERT INTO `inventory_water_profiles` SET name='" . mysqli_real_escape_string($connect, $_GET['name']); |
17 $sql .= "', calcium='" . $_GET['calcium']; |
17 $sql .= "', calcium='" . $_GET['calcium']; |
18 $sql .= "', bicarbonate='" . $_GET['bicarbonate']; |
18 $sql .= "', bicarbonate='" . $_GET['bicarbonate']; |