You have to pre-concatenate that information at your database level if
you're going to keep the same code. (e.g. MySQL would have
from($products, array('productid', 'CONCAT(productname," - ",
productcompany, " - ", year)'))
OR
you can loop through a rowset of a regular fetchAll result and perform
the concat in PHP. Unless you have a huge list it shouldn't take too
much further processing time.
Cheers
how can i do this when i have more data?
$products = new ProductTest();
$select = $products->select();
$select ->
from
($products,array("pruductid","productname","productcompany","year"))
-> where("prodtype='10'")
-> where('timestamp=?',"$zmtimestamp")
-> order("prodname");
and i want to get
Array ( [10] => Product 1 - Company1 - 2005
[30] => Product 2 - Company2 - 2008
[40] => Product 3 - Company1 - 2004
--
Simon Mundy | Director | PEPTOLAB
""" " "" """""" "" "" """"""" " "" """"" " """"" " """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654
4124
http://www.peptolab.com