Question on Structures_DataGrid and field labels
| From: | Dan Herman | Date: | Fri, 05 May 2006 12:50:13 +0000 |
| Subject: | Question on Structures_DataGrid and field labels | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23959@lists.php.net to get a copy of this message | ||
Hi, I have searched the mailing list archives and could not find an answer, so please forgive me if it is out there somewhere. Anyway my question is this:
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;
The columns for "sum(orderitems.qty)" and "(products.cost*sum(orderitems.qty))" are blank.
Can someone please show me how to define these properly with AddColumn so they do display data?
Thanks
Dan