如何将 zend_db_table_rowset 对象转换为 javascript 数组
$db=new Application_Model_DbTable_Books();
$result=$db->showBooks();
展示书籍:
class Application_Model_DbTable_Books extends Zend_Db_Table_Abstract
{
protected $_name = 'books';
protected $_primary = 'id';
public function showBooks(){
return $this->fetchAll();
}
我想将结果集转换为类似这样的东西:
var aDataSet = [
['Trident','Internet Explorer 4.0','Win 95+','4','X'],
['Trident','Internet Explorer 5.0','Win 95+','5','C'],
['Trident','Internet Explorer 5.5','Win 95+','5.5','A'],
['Trident','Internet Explorer 6','Win 98+','6','A']];