CI Active Record Query未更新

时间:2014-05-17 12:38:31

标签: php mysql codeigniter

我正在尝试更新数据库中的tenders表,但由于某些原因,它会使用零更新表。
获取last_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());

0 个答案:

没有答案