-- till <[EMAIL PROTECTED]> wrote
(on Wednesday, 26 September 2007, 04:43 PM +0200):
> On 9/26/07, Kexiao Liao <[EMAIL PROTECTED]> wrote:
> >
> > If I extend Zend_Db_Table_Abstract as MyTable class, and then instantiate
> > MyTable class as $myTable as showing below:
> >
> > $myTable = new MyTable(...);
> >
> > Then how do I get all the column names as an array for this table? Thanks
> > for your help.
> 
> I wouldn't mind if you checked the manual once or so. ;)
> 
> Anyway, here it is:
> http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.list-describe
> 
> You will have to query directly against the adapter, since
> Zend_Db_Table does not support this, but Zend_Db (which is ultimately
> "inside") does.

Actually, you *can* get the field names from Zend_Db_Table:

    $metadata = $table->info();
    $cols     = $metadata['cols'];

There's a lot more than just that available, too. Look up the info()
method in Zend_Db_Table_Abstract.
    
-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to