【发布时间】:2020-01-23 00:53:08
【问题描述】:
我正在尝试生成一个 pdf 报告,但我收到了这个错误:
Type: Error
Message: Cannot use object of type mysqli as an array
型号
function pdf($post_id)
{
$result = $this->db->query("SELECT * FROM tb_data_utama WHERE nipBaru='$post_id'");
return $result;
}
控制器
function getpdf()
{
$this->load->model('model_user');
$this->load->library('pdf');
$post_id = $this->uri->segment(3);
$x['data'] = $this->model_user->pdf($post_id);
$html = $this->load->view('GeneratePdfView', $x, [], true);
$this->pdf->createPDF($html, 'mypdf', false);
}
【问题讨论】:
标签: php html codeigniter