确保是否删除表中的行


Make sure whether row in a table is deleted

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.php318

尝试阅读精美的手册

echo $this->connection->mysqli_conn->affected_rows;