I have a small problem with a function that needs to check if there is a row with a specific ID. The database contains a row, but the function does not display anything.
public function hasInvoice(int $invoice_ID)
{
var_dump($invoice_ID);
$stmt_check = $this->db->prepare("SELECT * FROM `Invoice` WHERE 'OrderID'=?");
var_dump($stmt_check);
$stmt_check->bind_param("i", $invoice_ID);
$stmt_check->execute();
if ($stmt_check->num_rows > 0) {
var_dump("Invoice already exist");
return true;
}
var_dump("Invoice not exist");
return false;
}
Does anyone have any idea what I did wrong in the content of the function, that it seems to be correct, but it still doesn't work. Thanks in advance.