robsg wrote:
> 
>               
> Array ( [10] => Product 1
>         [30] => Product 2
>         [40] => Product 3
>         [60] => Product 4 
>         [80] => Product 5
>         [88] => Product 6
>         [90] => Product 7
>         [100] => Product 8
>        ... and so on
> 

There is a method of Zend_Db_Adapter that returns results in this format. 
You should be able to use the Select object as the query
       
$products = new ProductTest();
$select = $products->select();
$select -> from($products,array("pruductid","productname")) 
  -> where("prodtype='10'")
  -> where('timestamp=?',"$zmtimestamp")
  -> order("prodname");

Here's the usage of the adapter method.  It returns an simple PHP
associative array, not a Zend_Db_Table_Rowset object, so there is no need to
use toArray().

$result2Array = $products->getAdapter()->fetchPairs($select);

See also
http://framework.zend.com/manual/en/zend.db.html#zend.db.adapter.select.fetchpairs

Regards,
Bill Karwin

-- 
View this message in context: 
http://www.nabble.com/How-i-can-fetch-array-only-with-desired-data--tp17780211p17784524.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to