我一直在研究CodeIgniter项目,当我将数据发送到名为 - merchant_registration的视图作为数组时
控制器
function Merchant_Registration($para1 = '', $para2 = '') {
if (!$this->crud_model->admin_permission('report')) {
redirect(base_url() . 'index.php/admin');
}
if ($para1 == 'edit') {
$page_data['vendor_data'] = $this->db->get_where('vendor', array(
'vendor_id' => $para2
))->result_array();
$this->load->view('back/admin/merchant_edit', $page_data);
} elseif ($para1 == 'update') {
$page_data['status'] = $this->input->post('status');
$this->db->where('vendor_id', $para2);
$this->db->update('vendor', $page_data);
redirect(base_url() . 'index.php/admin/Merchant_Registration/', 'refresh');
recache();
} else {
$this->db->order_by('vendor_id', 'ased');
$create_timestamp = $this->input->post("create_timestamp");
$status = $this->input->post("status");
//search query
//change the dates to the proper column
//and find the package column and
//$date = DateTime::createFromFormat('Y-m-d"', $create_timestamp);
$page_data['query'] = $this->db->query("select * from vendor where create_timestamp >= UNIX_TIMESTAMP($create_timestamp) and create_timestamp <= UNIX_TIMESTAMP($create_timestamp) or status like '%$status%'")->result_array();
$page_data['page_name'] = "Merchant_Registration";
$this->load->view('back/index', $page_data);
}
}
显示此错误:
严重性:错误
消息:调用非对象
上的成员函数row()文件名:back / index.php
行号:5
回溯:
索引文件
<?php
$system_name = $this->db->get_where('general_settings',array('type' => 'system_name'))->row()->value;
$system_title = $this->db->get_where('general_settings',array('type' => 'system_title'))->row()->value;
?>
<?php include 'includes_top.php'; ?>
<body onbeforeunload="HandleBackFunctionality()">
<div id="container" class="effect mainnav-lg">
<!--NAVBAR-->
<?php include 'header.php'; ?>
<!--END NAVBAR-->
<div class="boxed" id="fol">
<!--CONTENT CONTAINER-->
<div>
<?php
include $this->session->userdata('title').'/'.$page_name.'.php' ?>
</div>
<!--END CONTENT CONTAINER-->
<!--MAIN NAVIGATION-->
<?php include $this->session->userdata('title').'/navigation.php' ?>
<!--END MAIN NAVIGATION-->
</div>
<!-- FOOTER -->
<?php include 'footer.php'; ?>
<?php include 'script_texts.php'; ?>
<!-- END FOOTER -->
<!-- SCROLL TOP BUTTON -->
<button id="scroll-top" class="btn"><i class="fa fa-chevron-up">
</i></button>
</div>
<!-- END OF CONTAINER -->
<!-- SETTINGS - DEMO PURPOSE ONLY -->
<?php include 'includes_bottom.php'; ?>
答案 0 :(得分:0)
我认为我在同时使用查询构建器和活动记录