当我试图从我的库中访问一个函数时,我遇到了上述错误,如图所示......
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class My_crud {
public function select_from($select, $from) {
// dafaults
$output = "";
// querying
$this->db->select($select);
$this->db->from($from);
$query = $this->db->get();
// if no rows returned
if ($uqery->num_rows == 0) {
return $output = "No Results Found";
}
// if row(s) retunred
return $output = $query->result_array();
}
}
而database
库设置为自动加载。