connect_error) { echo "

Connection Error!

"; die ($conn->error); }else{ // echo "

Connection OK!

"; // query the database $myQuery = "select elevation from eastern where name='$areaName'"; $result = $conn->query($myQuery); if ($result->num_rows == 0) { echo "No Match"; die($conn->error); } else { // pull out the elevation portion // This is what is sent back to jQuery $obj = $result->fetch_object(); echo "$obj->elevation"; } } ?>