Friday, 6 September 2019

Update query | Prepare statement

MYSQL prepare query for update using PHP


function SavePaymentStatus($status,$refno)
{
$stmt = $this->conn->stmt_init();
if ($stmt->prepare("update rlss4 set id10=? where id2=?"))
{
$stmt->bind_param("ss", $status, $refno);
$stmt->execute() or die("<h1>Error</h1>".mysqli_error($this->conn));     
$stmt->close();
return true;
}
else
{
return false;
}
}

No comments:

Post a Comment