|
1 <?php |
|
2 require_once('config.php'); |
|
3 |
|
4 $query = "SELECT * FROM inventory_fermentables ORDER BY name"; |
|
5 $connect = mysqli_connect(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); |
|
6 if (! $connect) { |
|
7 echo "[]"; |
|
8 return; |
|
9 } |
|
10 $result = mysqli_query($connect, $query); |
|
11 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { |
|
12 $fermentables[] = array( |
|
13 'record' => $row['record'], |
|
14 'name' => $row['name'], |
|
15 'type' => $row['type'], |
|
16 'yield' => $row['yield'], |
|
17 'color' => $row['color'], |
|
18 'add_after_boil' => $row['add_after_boil'], |
|
19 'origin' => $row['origin'], |
|
20 'supplier' => $row['supplier'], |
|
21 'coarse_fine_diff' => $row['coarse_fine_diff'], |
|
22 'moisture' => $row['moisture'], |
|
23 'diastatic_power' => $row['diastatic_power'], |
|
24 'protein' => $row['protein'], |
|
25 'max_in_batch' => $row['max_in_batch'], |
|
26 'recommend_mash' => $row['recommend_mash'], |
|
27 'graintype' => $row['graintype'], |
|
28 'di_ph' => $row['di_ph'], |
|
29 'inventory' => $row['inventory'], |
|
30 'cost' => $row['cost'] |
|
31 ); |
|
32 } |
|
33 echo json_encode($fermentables); |