資料庫insert問題
請問一下在
$this->db->update
或
$this->db->insert
時
要怎麼樣才能輸入中文
為什麼每次新增中文資料都失敗
英文就可以!
需要加什麼參數嗎? 不可能,肯定是你的语句有问题,看看编码问题。 $Name = $_POST['Name'];
$Idcard = $_POST['Idcard'];
$Address = $_POST['Address'];
$d1 = array('name'=> $Name,
'idcard'=> $Idcard,
'address'=> $Address,
);
$this->load->database();
$this->db->where('idcard =',$tt);
$this->db->update('idcard',$d1);
這樣有錯?需要加什麼參數嗎
底下是我database得參數
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "postgres";
$db['default']['password'] = "12345";
$db['default']['database'] = "stude";
$db['default']['dbdriver'] = "postgre";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";
$db['default']['port'] = 5432; 不明白为什么不用$this->input->post('name');
而用$_POST['name'] 跟踪下看看究竟执行的sql语句是什么
页:
[1]