www/includes/db_product.php

changeset 192
7f69b43e6084
parent 185
4c25db9e8102
child 235
0a063ac5d7f5
equal deleted inserted replaced
191:fd1d7225ca6e 192:7f69b43e6084
336 336
337 /* 337 /*
338 * SELECT, produce a list of products that can be fermented. 338 * SELECT, produce a list of products that can be fermented.
339 */ 339 */
340 if (isset($_GET['select']) && ($_GET['select'] == "ferment")) { 340 if (isset($_GET['select']) && ($_GET['select'] == "ferment")) {
341 $query = "SELECT code,name,stage FROM products WHERE "; 341 $query = "SELECT code,name,uuid,stage FROM products WHERE ";
342 $query .= "stage='Wait' OR stage='Brew' OR stage='Primary' OR stage='Secondary' OR stage='Tertiary' OR stage='Carbonation' ORDER BY code;"; 342 $query .= "stage='Wait' OR stage='Brew' OR stage='Primary' OR stage='Secondary' OR stage='Tertiary' OR stage='Carbonation' ORDER BY code;";
343 $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect)); 343 $result = mysqli_query($connect, $query) or die("SQL Error 1: " . mysqli_error($connect));
344 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { 344 while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
345 $brews[] = array( 345 $brews[] = array(
346 'code' => $row['code'], 346 'code' => $row['code'],
347 'name' => $row['name'], 347 'name' => $row['name'],
348 'uuid' => $row['uuid'],
348 'stage' => $row['stage'] 349 'stage' => $row['stage']
349 ); 350 );
350 } 351 }
351 echo json_encode($brews); 352 echo json_encode($brews);
352 return; 353 return;

mercurial