<?php
$data = array();
$id = $_GET['id'];

$var =  str_replace(array( '[', ']' ), '', $id);


//$mysqli = new mysqli("localhost","vps10082_inspect","kw8!boB#C}_d","vps10082_oliacInspections");
$mysqli = new mysqli("localhost","vps10082_inspect","kw8!boB#C}_d","vps10082_oliacInspections");

// Check connection
if ($mysqli -> connect_errno) {
  echo "Failed to connect to MySQL: " . $mysqli -> connect_error;
  exit();
}else{

    $desc = "Select * FROM inspection_description
     WHERE id IN ($var)";
    $descRes = $mysqli->query($desc);
    while($rowDesc = mysqli_fetch_array($descRes)){

      $data[] = array('id'=>$rowDesc['id'],
      'Desc'=>$rowDesc['Flaw Description'],
        'Cat'=>$rowDesc['Category']) ;

    }



    echo json_encode($data);


}


?>
