Re: Question on Structures_DataGrid and field labels

From: Date: Fri, 05 May 2006 13:19:08 +0000
Subject: Re: Question on Structures_DataGrid and field labels
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23961@lists.php.net to get a copy of this message
Dan Herman wrote: > I am sending a custom query to a DB_DataObject and then binding the > dataobject to the datagrid. My problem is that when my query has > arithmetic in it the columns do not display. > > An example query might be something like: > > SELECT > products.partNumber,sum(orderitems.qty),products.cost,(products.cost*sum(orderitems.qty)) > FROM orderitems,products WHERE orderitems.litunum = products.sku GROUP > BY products.partNumber; Not sure, what DB_DO does with this query, but maybe adding 'AS xyz' after the calculations will help. For example, you could write "sum(orderitems.qty) AS sum" and "(products.cost*sum(orderitems.qty))" AS mult" in your query. 'sum' and 'mult' would then be your field names. HTH, Mark

« previous php.pear.general (#23961) next »