<?php


if($_SERVER["REQUEST_METHOD"]=="POST"){

    createUser();
}
function createUser()
{

    //global $connect;

    $servername = "localhost";
    $username = "dotrazie_android";
    $password = "12345!@#$%";
    $dbname = "dotrazie_android";

// Create connection
    $conn = new mysqli($servername, $username, $password,$dbname);

    //$telefon = $_POST["telefon"];
    $orderID = $_POST["orderID"];

    //$age = $_POST["age"];

    //$query = "Insert into tblComenzi(IDCafea,IDClient,Variatie,LapteSoya,ExtraShot,NivelLapte,NivelSpuma,Latitude,Longitude,Estimation,Total) values (1,2,'test','true','true',50,10,12.123123,12.121212,'10 min',10)";

    $query = "SELECT Status FROM `tblComenzi` WHERE ID = $orderID;";

    $result = mysqli_query($conn,$query);

    //$response = array();
    $row = mysqli_fetch_array($result);




//    while ($row = mysqli_fetch_array($result))
//    {
//        array_push($response,
//            array(
//                "Status"=>$row[0]
//            ));
//    }


    if (mysqli_query($conn, $query) or die (mysqli_error($conn) . "\nquery:" . $query)) echo $row[0];
    mysqli_close($conn);

}

?>
