CodeIgniter 関数でファイルのアップロードをセットアップしようとしています。
しかし、何をしようとしても、エラーが発生します...
誰かが私の問題を解決する方法を手伝ってくれますか?
コントローラーの私の機能。
function insert_user_details(){
$this->load->library('form_validation');
$this->form_validation->set_rules('UserName', 'Username', 'callback_username_check');
//$this->form_validation->set_rules('Password', 'Password', 'required');
//$this->form_validation->set_rules('Email', 'Email', 'required|email');
//$this->form_validation->set_rules('FirstName','FirstName', 'required');
//$this->form_validation->set_rules('MiddleName','FirstName', 'required');
//$this->form_validation->set_rules('LastName','FirstName', 'required');
if ($this->form_validation->run() == FALSE)
{
echo 'Please Fill in the Forms Correctly' ;
}
else
{
$config['upload_path'] = '../user_uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$pass = $this->input->post('Password');
$pass = md5($pass);
$data = array(
'UserName'=>$this->input->post('UserName'),
'Password'=>$pass,
'FirstName'=>$this->input->post('FirstName'),
'MiddleNames'=>$this->input->post('MiddleName'),
'LastName'=>$this->input->post('LastName'),
'DateOfBirth'=>date('Y-m-d',strtotime($_POST['DateOfBirth'])),
'AddressLine1'=>$this->input->post('AddressLine1'),
'AddressLine2'=>$this->input->post('AddressLine2'),
'City'=>$this->input->post('City'),
'CountryID'=>$this->input->post('CountryID'),
'NationalityCountryID'=>$this->input->post('NationalityCountryID'),
'MobileNo'=>$this->input->post('MobileNo'),
'WorkPhoneNo'=>$this->input->post('WorkPhoneNo'),
'WorkPhoneExtention'=>$this->input->post('WorkPhoneExtension'),
'NationalTaxNumber'=>$this->input->post('NationalTaxNumber'),
'NationalIDCardNo'=>$this->input->post('NationalIDCardNo'),
'MaritalStausID'=>$this->input->post('UI_LanguageID'),
'ReligionID'=>$this->input->post('ReligionID'),
'Photograph' => $this->upload->data(),
'Email'=>$this->input->post('Email'),
'WebUrl'=>$this->input->post('WebUrl'),
'HighestEducation'=>$this->input->post('HighestEducation'),
'UserResumeFile'=> 'res.jpg',
'UI_LanguageID'=> $this->input->post('UI_LanguageID'),
'LastLoginDate'=>'2013-02-24 00:00:00',
'LastLoginIP'=>'192.168.1.2',
'Remarks'=>$this->input->post('Remarks'),
'CreateByUserID'=>'1',
'CreateAt'=>'2013-02-24 00:00:00',
'ModifiedByUserID'=>'2',
'ModifiedAt'=>'2013-02-24 00:00:00',
'IsActive'=>'1'
);
$table = 'sys_user_accounts';
$this->common_model->insert_record($table, $data);
echo 'Success Message' ;
//$this->load->view('user_management/success','','true');
}
}
ここにビューファイルがあります。
'Photograph', 'id' => 'Photograph', 'placeholder' => 'ユーザーの写真をアップロード', 'maxlength' => '250' ); echo form_upload($input_field_attributes); ?>はい、私はマルチパートを使用しました
echo form_open_multipart('user_management/manage_users',array('id' => 'insert_user'));
では、firebug で以下のエラーが発生する理由を誰か教えてもらえますか? そしてそれを解決する方法??
> Error Number: 1054
Unknown column 'Array' in 'field list'
INSERT INTO `sys_user_accounts` (`UserName`, `Password`, `FirstName`, `MiddleNames`, `LastName`, `DateOfBirth`, `AddressLine1`, `AddressLine2`, `City`, `CountryID`, `NationalityCountryID`, `MobileNo`, `WorkPhoneNo`, `WorkPhoneExtention`, `NationalTaxNumber`, `NationalIDCardNo`, `MaritalStausID`, `ReligionID`, `Photograph`, `Email`, `WebUrl`, `HighestEducation`, `UserResumeFile`, `UI_LanguageID`, `LastLoginDate`, `LastLoginIP`, `Remarks`, `CreateByUserID`, `CreateAt`, `ModifiedByUserID`, `ModifiedAt`, `IsActive`) VALUES ('hello', '1a1dc91c907325c69271ddf0c944bc72', 'fda', 'fda', 'fad', '2010-03-03', '1', 0, '1', 0, 0, '1', '1', 0, '1', 0, 0, 0, Array, 0, 0, 0, 'res.jpg', 0, '2013-02-24 00:00:00', '192.168.1.2', 0, '1', '2013-02-24 00:00:00', '2', '2013-02-24 00:00:00', '1')
Filename: C:\xampp\htdocs\projects\zorkif_nextgen\system\database\DB_driver.php
Line Number: 330