function child_delete($c_no, $shift, $p_date, $dname) {
$p_status = 0;
$query = "DELETE from $this->tb1_name2 WHERE c_no=? AND time_slot=? AND p_date=? AND d_name=? AND p_status=?";
$statement = $this->connection->mysqli_conn->prepare($query) or die(mysqli_error($this->connection->mysqli_conn));
$statement->bind_param("dsssd", $c_no, $shift, $p_date, $dname, $p_status) or die(mysqli_error($this->connection->mysqli_conn));
$result = $statement->execute() or die(mysqli_error($this->connection->mysqli_conn));
print_r(mysqli_affected_rows($statement));
}
我使用上面的代码删除表中的行并确保该行被删除。但它给出了以下错误。
警告:mysqli_affected_rows() 期望参数 1 为 mysqli,对象在/opt/lampp/htdocs/NEW/patient_channel/controller/Patient_controller.php第318行