01 prepare('SELECT * FROM candata WHERE id > ?;'); 10 $sth->execute(array($maxID)); 11 $cnt = 0; 12 while ($row = $sth->fetch(PDO::FETCH_OBJ)) { 13  $ID[$cnt] = $row->id; 14  $TIMEST[$cnt] = $row->timestamp; 15  $FUELTEMP[$cnt] = hexdec($row->fueltemp); 16  $WATERTEMP[$cnt] = hexdec($row->watertemp); 17  $OILPRESSURE[$cnt] = hexdec($row->oilpressure); 18  $OILTEMP[$cnt] = hexdec($row->oiltemp); 19  $cnt++; 20 } 21 $result = array( 22  'NEWid' => $ID, 23  'NEWtime' => $TIMEST, 24  'NEWfueltemp' => $FUELTEMP, 25  'NEWwatertemp' => $WATERTEMP, 26  'NEWoilpressure' => $OILPRESSURE, 27  'NEWoiltemp' => $OILTEMP 28 ); 29 echo trim(json_encode($result)); 30 ?>