I have very simply problem, but i do not found solution. I call from server a PHP script /sqlphp/ajodbquery.php?ID="+kuljettajaid and it should return to me List[] with values.
If use this script SELECT all values, everything is fine, but when i will try use WHERE with variable, so it not work.
a part of PHP script is here:
$username = $_POST['ID'];
//creating an array for storing the data
$heroes = array();
//this is our sql query
$sql = "SELECT ID, LAHETTAJAID, VASTAANOTTAJAID, PURKUAIKA FROM AJOJARJESTELY WHERE KULJETTAJAID='$username'";
//creating an statment with the query
$stmt = $conn->prepare($sql);
//executing that statment
$stmt->execute();
//binding results for that statment
$stmt->bind_result($ID, $LAHETTAJAID, $VASTAANOTTAJAID, $PURKUAIKA);
//looping through all the records
while($stmt->fetch()){
//pushing fetched data in an array
$temp = [
'id'=>$ID,
'l'=>$LAHETTAJAID,
'vastaanottaja'=>$VASTAANOTTAJAID,
'purkuaika'=>$PURKUAIKA
];
If someone can find solution, thank you for support.