Php CI活动记录查询未更新

Php CI活动记录查询未更新,php,mysql,codeigniter,Php,Mysql,Codeigniter,我正试图更新数据库中的tenders表,但由于某些原因,它正在用零更新表。 获取last\u query()字符串并从phpmyadmin窗口运行后,它会成功更新,但使用活动记录时不会更新。 除此之外,其他查询工作正常 我的代码可能有什么问题 这是我的密码 $data=array( 'tender_type_type_id' => $this->input->post('tender_type_id'), 'Description

我正试图更新数据库中的
tenders
表,但由于某些原因,它正在用零更新表。
获取
last\u query()
字符串并从
phpmyadmin
窗口运行后,它会成功更新,但使用活动记录时不会更新。
除此之外,其他查询工作正常

我的代码可能有什么问题

这是我的密码

$data=array(
'tender_type_type_id' => $this->input->post('tender_type_id'),
                        'Description' =>  $this->input->post('tdescription'),
                        'obtaining_documents' => $this->input->post('obtaining_docs'),
                        'submission_process' => $this->input->post('submission_proc'),
                        'obtaining_documents' => $this->input->post('obtaining_docs'),
                        'applicationfee' => $this->input->post('applicationfee'),
                        'Location' => $this->input->post('location'),
                        'WebLink' => $this->input->post('url'),
                        'clossing_date' => $this->input->post('endson'),
                        'opening_date' => $this->input->post('openedon'),
                        'title' => $this->input->post('title'),
                        'publication_date' => date('Y-m-d H:i:s', time()),
                        'attachments' => $this->input->post('upload'),
                        'Organization_OrganizationID' => $this->input->post('organizationid'),
                        'tender_category_category_id' => $this->input->post('categoryid'),
                        'Towns_TownID' => $this->input->post('townid'),
                        'Accounts_AccountID' =>$this->input->post('accountid'),
                        'tender_status_status_id' => $this->input->post('tender_status_id'),
                        'Location' => $this->input->post('location'),
                        'clossing_date' => $this->input->post('endson'),
                        'opening_date' => $this->input->post('openedon'));

            $id=$this->uri->segment(3);
            $this->db->where('TenderID',$id);
            $this->db->update('tenders',$data);
            return print_r($this->db->last_query());

$id=$this->uri->segment(3);部分应该在控制器的函数中。除post部分外,其余代码应该在模型中。它不起作用,因为对于id,该值将变为null。@BuddhiEashwarage当您var_dump$id时,它具有正确的值。因此,这意味着在模型中使用它仍然有效,但last_query()只是已处理的查询,因此…请使用探查器而不是
last_query
$this->output->enable_profiler(TRUE)我打赌你会在几秒钟内发现错误。你能添加这个数据库表结构的障碍吗