www/gethopsources.php

changeset 58
83ccc36df675
child 69
ca25fdce3b85
equal deleted inserted replaced
57:bb9a06aa9acd 58:83ccc36df675
1 <?php
2 require_once('config.php');
3
4 $query = "SELECT * FROM inventory_hops 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 $hops[] = array(
13 'record' => $row['record'],
14 'name' => $row['name'],
15 'alpha' => $row['alpha'],
16 'beta' => $row['beta'],
17 'humulene' => $row['humulene'],
18 'caryophyllene' => $row['caryophyllene'],
19 'cohumulone' => $row['cohumulone'],
20 'myrcene' => $row['myrcene'],
21 'hsi' => $row['hsi'],
22 'total_oil' => $row['total_oil'],
23 'useat' => $row['useat'],
24 'type' => $row['type'],
25 'form' => $row['form'],
26 'origin' => $row['origin'],
27 'inventory' => $row['inventory'],
28 'cost' => $row['cost']
29 );
30 }
31 echo json_encode($hops);

mercurial