0
我的數據庫中有一個「登錄」和「個人資料」表。根據登錄ID顯示個人資料數據
登錄= [ 'id_login,用戶名,密碼等...']
輪廓= [ 'id_profile,id_login,全名,地址,等...']
模型
function my_model(){
$this->db->select('fullname, address, A.name_table, B.name_text');
$this->db->from('profile');
$this->db->join('A','A.id_table=profile.id_table');
$this->db->join('B','B.id_text=profile.id_text');
$query = $this->db->get();
if ($query->num_rows() > 0) {
return $query->row_array();
}
}
控制器
function my_controller(){
$data['view_profil']= $this->model->my_model();
$this->tmp->screen('my_view', $data);
}
我要問什麼。如何根據登錄ID顯示個人資料數據?如何在我的視圖文件中執行它?感謝您的幫助。
感謝兄弟,我可以在頁面視圖中顯示數據,但是當我在模型中使用命令'where'時,數據無法顯示並顯示錯誤消息。未解決的問題是根據登錄帳戶(登錄表)顯示配置文件表中的配置文件數據。對我有什麼建議嗎?非常感謝你的幫助。 – 2014-10-14 14:25:55