Код, который я использую в своей модели, выглядит следующим образом:
Код: Выделить всё
Public function get_news()
{
$this->db->select('id, text');
$this->db->select("DATE_FORMAT(date,'%W %D %M %Y')", FALSE);
$this->db->limit(10);
$this->db->order_by('date', 'desc');
$query = $this->db->get('news');
$result = $query->result_array();
return $result;
}
Код: Выделить всё
A PHP Error was encountered
Severity: Notice
Message: Undefined index: date
Filename: views/news.php
Line Number: 22
Backtrace:
File: C:\xampp\htdocs\tsh\CI\application\views\news.php
Line: 22
Function: _error_handler
File: C:\xampp\htdocs\tsh\CI\application\controllers\home.php
Line: 99
Function: view
File: C:\xampp\htdocs\tsh\public_html\index.php
Line: 292
Function: require_once
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/297 ... sing-mysql
Мобильная версия