connect_error) { die("Connection failed: " . $conn->connect_error); } $mykey = $_GET['keyID']; //echo "Arnel " . $mykey; if($mykey =="ReadDealerInfo6e59e008b5348b452b615a3033729daae383serviceTypeID"){ // SQL query $serviceTypeID = $_GET['serviceTypeID']; $sql = "SELECT * FROM `service_types` WHERE id='$serviceTypeID' LIMIT 1"; $result = $conn->query($sql); if ($result->num_rows > 0) { // Array to hold the results $rows = array(); // Fetch data from each row and add it to the array while($row = $result->fetch_assoc()) { $rows[] = $row; } // Output the result in JSON format header('Content-Type: application/json'); echo json_encode($rows); } else { echo "0 results"; } } // Close connection $conn->close(); ?>