InterviewSolution
Saved Bookmarks
| 1. |
I Want To Use A Sql Function Or Perform Calculations In A Statement I'm Generating With Zend_db_select. How Can I Do This? |
|
Answer» Actually, by DEFAULT, If your expression Includes parentheses, Zend Db Select will cast the statement APPROPRIATELY. However, If It does not, oryou are having problems, you can use Zend_Db_Exprto explicitly create the expression: /‘ Build the SQL: * SELECT p.”product_jd”, p.cost * 1.08 AS cost_plus_tax * FROM “PRODUCTS “ AS p $select = $db-->select() ->from(array(’p’ =>’products’), array( product_id’, ‘cost_plus_tax’ => NEW Zend_Db_Expr(‘p.cost * l.08’), ));Actually, by default, If your expression Includes parentheses, Zend Db Select will cast the statement appropriately. However, If It does not, oryou are having problems, you can use Zend_Db_Exprto explicitly create the expression: |
|