0
我遇到了codeigniter + postgresql的一個奇怪問題。 這是我的表:CodeIgniter:查詢未執行
sLearning=> select * from lezione;
id | titolo | descrizione | data | corsoid
----+------------------+-------------+------------+---------
1 | prova | | 2014-10-09 | 1234
2 | Lezione di oggi! | | 2014-10-09 | 1234
(2 rows)
我已經手動插入這兩個記錄來測試我的查詢。順便說一句,這是我的模型Lezione_m內:(我去掉了一些檢查和其他控制,但無論如何,即使這個版本是不工作:)
public function get_lezione()
{
echo $this->db->_error_message();
$query = $this->db->get('lezione');
return $query->result();
}
這是我的控制器:
class Test_c extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('Lezione_m');
}
public function index()
{
$this->load->view('test', $data);
$this->output->enable_profiler(TRUE);
echo '<pre>';
print_r($this->Lezione_m->get_lezione(null, 1234));
echo '</pre>';
}
的print_r的:
Array
(
)
什麼剖析說,關於我的查詢:
0.0001 SELECT *
FROM "lezione"
不知道這裏發生了什麼。我很確定codeigniter它連接到數據庫(在這種情況下,我會得到某種錯誤)。