logo
  • 教程列表
  • SO官方文檔
  • 在 codeigniter 中使用 Model
    • 呼叫模型函式
    • 建立模型
    • 將資料返回給控制器
    • 載入模型
    • 將資料傳遞給模型
    • 從控制器接收資料
  1. StackOverflow 文件
  2. codeigniter 教程
  3. 在 codeigniter 中使用 Model
  4. 將資料返回給控制器

將資料返回給控制器

Created: November-22, 2018

public function get_username($uid)
{
            $query = 
            $this->db->select('id')
             ->select('name')
             ->from('user_table')
             ->where('id', $uid)
             ->get();
        return $query->result_array();
}

這將返回帶有匹配的 id 和使用者名稱的結果到控制器。

  • 載入模型
  • 建立模型

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明