なぜ私のコードは、ボタンの提出をクリックし、リンク検索をクリックした後、このエラーが発生しました:
私はcodeigniterを使用しています。jQuery-ajaxのデバッグ用のマイコード!?
An error has occured:
[object Object]
error
と、この私のTour_foreign-> CI_Controller:
function search_customer(){
$customer_number = $this->input->post('customer_number');
$query = $this->db->get_where('customer', array('customer_number' => $customer_number));
if($query->num_rows()==0){
echo '0';
}else{
$data = array();
foreach ($query->result() as $row)
{
$data[] = $row;
}
echo json_encode($data);
}
}
function insert_customers(){
$customer_number = "";
for($i = 0; $i < 10; $i++)
$customer_number .= mt_rand(0, 9);
/*////////////////////////////////////*/
$jdate = jgmdate("j F Y");
/*////////////////////////////////////*/
$useradmin = $this->session->userdata('login');
$query = $this->db->get_where('login', array('useradmin' => $useradmin))->row();
$nameadmin = $query->nameadmin;
$lastnameadmin = $query->lastnameadmin;
/*////////////////////////////////////*/
$data = array (
'customer_number' => $customer_number,
'name' => $this->input->post('name'),
'name_en' => $this->input->post('name_en'),
'father_name' => $this->input->post('father_name'),
'number_birth_certificate' => $this->input->post('number_birth_certificate'),
'national_number' => $this->input->post('national_number'),
'passport_number' => $this->input->post('passport_number'),
'term_passport' => $this->input->post('term_passport'),
'date_of_birth' => $this->input->post('date_of_birth') ,
'phone' => $this->input->post('phone'),
'mobile' => $this->input->post('mobile'),
'address' => $this->input->post('address'),
'nationality' => $this->input->post('nationality'),
'accommodation' => $this->input->post('accommodation'),
'education' => $this->input->post('education'),
'zip_code' => $this->input->post('zip_code'),
'marital_status' => $this->input->post('marital_status'),
'bank_name' => $this->input->post('bank_name'),
'branch_name' => $this->input->post('branch_name'),
'card_number' => $this->input->post('card_number'),
'account_number' => $this->input->post('account_number'),
'zip_code' => $this->input->post('zip_code'),
'job' => $this->input->post('job'),
'date_submit' => $jdate,
'useradmin_submit' => $nameadmin.' '.$lastnameadmin ,
);
//if(!empty($data)){
$this->db->insert('customer', $data);
//}
}
あなたはfirebugでコードをデバッグしようとしましたか?私はあなたが500の内部サーバーエラーを取得しているのを見ることができます。 – Dave
yes、firebugとchorme consoleで試しましたが、結果は –
ではありませんでしたが、私が言ったのと同じエラーが表示されます –