How can I get collection result "column headers" or "column names" from query?
Suppose I have $data = Mage::getModel('catalog/product')->getCollection();
and I have some joins with other tables
I can get the data by running foreach on $data
giving me the actual output data.
question: but how can I get the "header name" (or "column name") as I would see it when I run the same query in MySQL
Best Answer
For a simple query like
SELECT * FROM 'sales_flat_order'
To get all product attributes from
Mage::getModel('catalog/product')->getCollection()
just use keys from$item->getData()
.