www/includes/db_inventory_water_profiles.php

changeset 37
9362eb9e9e5b
parent 22
99c02fa797f9
equal deleted inserted replaced
36:4b829f689d7e 37:9362eb9e9e5b
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'];

mercurial