第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

錯誤消息:調(diào)用未定義的方法 CI_DB_mysqli_result::results()

錯誤消息:調(diào)用未定義的方法 CI_DB_mysqli_result::results()

PHP
至尊寶的傳說 2022-06-17 14:18:09
我是 CodeIgniter 的新手,在連接 db 后遇到以下錯誤。如果有人可以幫助我,那真是太好了。我檢查了 StackOverflow 中以前的答案,但沒有一個對我有幫助。下面是控制器代碼    <?phpdefined('BASEPATH') OR exit('No direct script access allowed');class Welcome extends MY_Controller {    public function index() {        $this->load->view('home');    }    public function adminRegister() {        //loading teh queries model         $this->load->model('queries');        //Calling the getRoles function inside the roles        $roles = $this->queries->getRoles();        print_r($roles);        exit();        $this->load->view('register');    }    public function login() {        echo 'login';    }}型號代碼    <?php//Details of queries whicha re used to interact with teh databaseclass Queries extends CI_Model {//Created a function with the name getRoles      public function getRoles() {        //Fetch the reocrds from the table        $roles = $this->db->get('tbl_roles');        if ($roles->num_rows() > 0) {            return $roles->results();        }    }}?>目前不使用來自控制器的數(shù)據(jù)。任何幫助將不勝感激。提前致謝。
查看完整描述

1 回答

?
波斯汪

TA貢獻(xiàn)1811條經(jīng)驗 獲得超4個贊

沒有結(jié)果應(yīng)該是結(jié)果


參考CI 文檔


class Queries extends CI_Model {

    //Created a function with the name getRoles  

        public function getRoles() {

            //Fetch the reocrds from the table

            $roles = $this->db->get('tbl_roles');

            if ($roles->num_rows() > 0) {

                return $roles->result();

            }

        }


    }


查看完整回答
反對 回復(fù) 2022-06-17
  • 1 回答
  • 0 關(guān)注
  • 150 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號