You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
595 B
19 lines
595 B
<?php
|
|
$bdd = new SQLite3('../../database/ticket_panne.db', SQLITE3_OPEN_READWRITE);
|
|
|
|
try {
|
|
// $reponse = $bdd->query("SELECT * FROM pannes WHERE `" .$_POST['champ'] ."`='" .$_POST['value'] ."'");
|
|
$reponse = $bdd->prepare("SELECT * FROM pannes WHERE :champ=:value");
|
|
$reponse->bindParam(':champ', $_POST['champ']);
|
|
$reponse->bindValue(':value', $_POST['value']);
|
|
$fetch = $reponse->execute();
|
|
$result = [];
|
|
while ($line = $fetch->fetchArray()) {
|
|
array_push($result, $line);
|
|
};
|
|
|
|
print_r(json_encode($result));
|
|
} catch (Exception) {
|
|
echo false;
|
|
}
|
|
?>
|
|
|