$id = $getir['RECEIPTID'];
$stok_listesi = $db->prepare("SELECT * from STOCK where STOCKID = $id ");

şeklinde deneyebilirsin hocam.