|
1 <?php |
|
2 require_once('config.php'); |
|
3 |
|
4 $query = "SELECT * FROM inventory_miscs 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 $miscs[] = array( |
|
13 'record' => $row['record'], |
|
14 'name' => $row['name'], |
|
15 'type' => $row['type'], |
|
16 'use_use' => $row['use_use'], |
|
17 'time' => $row['time'], |
|
18 'amount_is_weight' => $row['amount_is_weight'], |
|
19 'inventory' => $row['inventory'], |
|
20 'cost' => $row['cost'] |
|
21 ); |
|
22 } |
|
23 echo json_encode($miscs); |