使用php删除两个相关表中的数据

<?php
$conn = new mysqli("localhost", "root", "", "hcis") or die(mysqli_error());
$conn->query("DELETE FROM `itr` NATURAL JOIN `vaccine` WHERE `itr_no` = '$_GET[id]'") or die(mysqli_error());
header("location:patient.php");
?>

This is my sample code. I'm planning to delete data in two related tables and when i run it i get this error:

Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\xampp\htdocs\thesis\admin\delete_patient.php on line 3

Please help.. I think my query is incorrect.

You forgot to pass your connection object inside mysqli_error Just replace your

mysqli_error()

with

mysqli_error($conn)

For more about mysqli_error, you can take reference from here