Trying to delete a record with PHP

I’m trying to delete a record and update a table using a stored procedure but I can’t seem to even get the error message to display properly. Below is my php and stored procedure:

[php]$fileID = 11719;
$rmaID = 2932;
// if confirm deletion button has been clicked, delete record
if (isset($_POST[‘delete’])) {
$stmt = mysqli_prepare($conn, ‘CALL update_new_sn(?, ?)’);
mysqli_bind_param(‘ii’, $fileID, $rmaID);

$deleteRecord = mysqli_execute($stmt);
	
if (!$deleteRecord) {
	echo "Error!: ", mysqli_error($stmt);
} else {
	header('Location: http://www.example.com/my_page');
}
// if there's an error affected_rows is -1

}
[/php]

Stored Procedure

DROP PROCEDURE update_new_sn//
CREATE DEFINER=admin@localhost PROCEDURE update_new_sn(in selectedID int, in selectedRMAID int)
begin

delete from dropbox where id = selectedID;
update rma set ref_status_id = 0 where id = selectedRMAID;

end

try

[php]$deleteRecord = $stmt->execute();[/php]

instead of

[php]$deleteRecord = mysqli_execute($stmt);[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service