|
我将下面函数中的//$this->db->order_by("id", "desc");
//$query = $this->db->get('news',$num,0);
替换为
$query = $this->db->query("select * from news order by id desc limit ".$num."");
为什么就会报
Table 'demodb.news' doesn't exist
select * from news order by id desc limit 5
难道它们不是相等的用法吗
function getLastNews($num)
{
//$this->db->order_by("id", "desc");
//$query = $this->db->get('news',$num,0);
$query = $this->db->query("select * from news order by id desc limit ".$num."");
if ($query->num_rows() > 0)
{
return $query;
}
} |
|