<?php
include('con.php');

if (isset($_POST['state'])) {
    $state = $_POST['state'];
    $priceQuery = mysqli_query($ahk_conn, "SELECT rate FROM price WHERE service='$state'");
    if ($priceQuery && mysqli_num_rows($priceQuery) > 0) {
        $priceData = mysqli_fetch_assoc($priceQuery);
        echo floatval($priceData['rate']);
    } else {
        echo "0";
    }
}
?>
