hi im wondering how will i create an excel files from the returned rows?
//Code
$table = new Model_Crescores();
$select = $table-select();
$select-order('cap_no');
$array = $table-fetchAll($select);
// the results in $array will be converted to excel i tried this tutorial
Hi.
Zend_Db_Table_Abstract::fetchAll() * @return Zend_Db_Table_Rowset_Abstract
The row results per the Zend_Db_Adapter fetch mode. So, its
Zend_Db_Table_Rowset_Abstract
type you get, not an array.You can use Zend_Db_Table_Rowset_Abstract::toArray()
if you want an array, or iterate trough
so i need to convert $array to an array? by using this
Zend_Db_Table_Rowset_Abstract::toArray($array)???
--
View this message in context:
http://www.nabble.com/Create-an-Excel-file-from-the-returned-table-rows-tp24474784p24474874.html
Sent from the Zend Framework mailing list archive at
O.K.
Let's fix your code:
//Your
$table = new Model_Crescores();
$select = $table-select();
$select-order('cap_no');
$array = $table-fetchAll($select);
//Fixed
$table = new Model_Crescores();
$select = $table-select();
$select-order('cap_no');
$rowset = $table-fetchAll($select);
$array =
thank you very much really appreciate it ^^ im still not use and aware in
some zend functionality thanks
--
View this message in context:
http://www.nabble.com/Create-an-Excel-file-from-the-returned-table-rows-tp24474784p24475082.html
Sent from the Zend Framework mailing list archive at
Just check datatype before use variables, zf is well documented and it's
easy to navigate methods and look into docblocks.
Regards,
Saša Stamenković
On Tue, Jul 14, 2009 at 9:45 AM, jigen7 i_love_ji...@yahoo.com wrote:
thank you very much really appreciate it ^^ im still not use and aware in
And now for your Excel export code, given a random array stored in $array.
?php
// Set filename for download
$fileName = 'my_excel_export';
if (count($array) == 0) {
throw new Zend_Exception('Sorry, there is no data available to
export.');
}
else {
// Initiate data variable that