I dunno how to describe the problem. I'm trying to fetch and I tried the query in PHPmyAdmin it is good it returns the result but when I transfer it to PHP.
The error is undefined variable.
Here is my code. Kindly help me please I'm stuck here for 2 hours thank you!
$targetint_id = $_GET["int_id"];
$targetbrch_id = $_GET["brch_id"];
$targetcst_id = $_GET["cst_id"];
$targetcbrch_id = $_GET["cbrch_id"];
$targetdateadded = $_GET["dateadded"];
$targettimeadded = $_GET["timeadded"];
$stmt = $db->prepare("SELECT * FROM tbl_soldinventory where int_id= :int and brch_id= :brch and cst_id= :cst and cbrch_id= :cbrch and date= :date and timeadded= :time");
$stmt->execute(array(':int' => "$targetint_id", ':brch' => "$targetbrch_id",':cst' => "$targetcst_id", ':cbrch' => "$targetcbrch_id",':date' => "$targetdateadded", ':time' => "$targettimeadded"));
while($rows = $stmt->fetch(PDO::FETCH_ASSOC))
{
$dateadded = $rows["date"];
$timeadded = $rows["timeadded"];
$quantity = $rows["quantity"];
}
echo $dateadded;