dongpo1216 2015-03-19 09:55
浏览 37

Zend Framework v.1.12不会在没有 - > limit()的情况下从数据库返回数组

In Zend Framework v. 1.12 I have to return an array of results from database, if I use ->limit() it works if limit is lower than 10.000, otherwise if I don't use LIMIT or LIMIT is greater than 10.000, it doesn't work.

//SELECT * FROM customers -> not works
//SELECT * FROM customers LIMIT 10000-> works

//here's the code
$query = $this->db->select();
$query->from(array('c'=>'customers'));

$query->limit(50); 
$stmt = $this->db->query($query);
$result = $stmt->fetchAll();
Zend_Debug::dump($result);
  • 写回答

0条回答 默认 最新

    报告相同问题?