The code to fetch data from columns is:
<?php
/**
* Get the resource model
*/
$resource = Mage::getSingleton('core/resource');
/**
* Retrieve the read connection
*/
$readConnection = $resource->getConnection('core_read');
/**
* Retrieve our table name
*/
$table = $resource->getTableName('catalog/product');
/**
* Execute the query and store the results in $results
*/
$sku = $readConnection->fetchCol('SELECT sku FROM ' . $table . ');
/**
* Print out the results
*/
var_dump($results);
So what is the code for fetching data from a row? Is it like this?
<?php
/**
* Get the resource model
*/
$resource = Mage::getSingleton('core/resource');
/**
* Retrieve the read connection
*/
$readConnection = $resource->getConnection('core_read');
/**
* Retrieve our table name
*/
$table = $resource->getTableName('catalog/product');
/**
* Execute the query and store the results in $results
*/
$sku = $readConnection->fetchRow('Random Query');
/**
* Print out the results
*/
var_dump($results);
Or is there any special procedure for it?
Best Answer
Or you can use different attribute sets to make filtration on the row data entity you need.
you can use a number of addtofilter or attribute type search
This is the way by which we can use the attribute label to sort.