Melly getDog test

This commit is contained in:
2022-12-16 01:07:49 +01:00
parent a1727381ba
commit accf248e3c
2 changed files with 5 additions and 1 deletions

View File

@ -24,9 +24,13 @@ $db_connection = new Database();
$conn = $db_connection->dbConnection();
$data = json_decode(file_get_contents("php://input"));
// $data = json_decode('{ "qr_id": "m7MdMK" }');
$returnData = [];
$fields = ['fields' => ['qr_id']];
// if(true)
// IF REQUEST METHOD IS NOT EQUAL TO POST
if($_SERVER["REQUEST_METHOD"] != "POST")
{
@ -50,7 +54,7 @@ else
$fetch_user_by_email = "SELECT * FROM `dogs` WHERE `qr_id`=:qr_id";
$query_stmt = $conn->prepare($fetch_user_by_email);
$query_stmt->bindValue(':qr_id', $email,PDO::PARAM_STR);
$query_stmt->bindValue(':qr_id', $qr_id,PDO::PARAM_STR);
$query_stmt->execute();
// IF THE dog IS FOUNDED BY qr_id