我userlisting提供鏈接編輯用戶和更新配置文件時,一個點擊,然後它去更新個人資料視圖與相應用戶的ID的用戶的屏幕名稱爲:我的CodeIgniter控制器與id一起作爲參數傳遞,只是一直使用一個特定的id?
//url:
localhost/damcombd/admin/userprofile/userupdate/3
形式加載好的和地址欄並在鼠標懸停狀態欄上都顯示鏈接如上 但實際上在控制器中,如果我拉這個ID的東西說來自用戶模型,它只是去第一個記錄或ID 1 ..並一直這樣做。儘可能地嘗試!
可能是什麼原因?檢查是否有硬編碼的ID太..但是這並非如此..
//with this one too I create a row and get it back like:
$this->commonmodel->create_and_get($table,$data){
$this->db->insert($table,$data);
$lastid=$this->db->insert_id();
$getback=$this->db->get($table,array('id'=>$lastid))->result_array();
return $getback[0];
但它返回每一次的第一行..我不知道像USERPROFILE更新上述這其中也拉屎各地..它是錯誤或something..I不要在all..try得到它,因爲我可能:(:(請做一些事情..
我認爲你可以使用 - > row_array()而不是 - > result_array()來獲取第一行。以防萬一你沒有這樣做,閱讀手冊與此選擇http://ellislab.com/codeigniter/user-guide/database/active_record.html#select和更重要的是,獲取結果:http:// ellislab.com/codeigniter/user-guide/database/results.html – Chococroc
是啊你說的對..我讀過它。謝謝 – edam