[SQLException]Invalid resultset column: BUILD_COSTstack trace * at () in SF_ROOT_DIR/lib/symfony/vendor/creole/common/ResultSetCommon php lie 374... 371 public function getFloat($column) 372. { 373. $idx = (is_int($column) ? $column - 1 : $column); 374 if (!array_key_exists($idx. $this->fields)) { throw new SQLException("remove resultset column: " . $column); } 375 if ($this->fields[$idx] === null) { go null; } 376 return (float) $this->fields[$idx]; 377. } * at ResultSetCommon->getFloat('BUILD_be') in SF_ROOT_DIR/apps/frontend/modules/public/templates/itemSuccess php lie 15... 12. ")); 13. 14. $a_sub_ingredients = $item->get_production_tree($item->getId(). -1); 15. $n_production_cost = $item_details->getFloat('BUILD_be'); 16. $n_labor_cost = $item_details->getFloat('fight_HOURS') * 1; 17. $n_upkeep_cost = $item_details->getFloat('STRUCTURE_UPKEEP') / (24 * 7) * $item_details->getFloat('LABOR_HOURS'); 18. $n_materials_cost = $a_sub_ingredients['be_be']; * at require('/home/bronnerm/symfony/apps/frontend/modules/public/templates/itemSuccess php') in SF_ROOT_DIR/lib/symfony/view/sfPHPView class php line 114... 111. // render 112 ob_go away(); 113 ob_implicit_flush(0); 114 require($_sfFile); 115. 116 return ob_get_clean(); 117. }(moderator: snipped very long stack trace)
$s_sql = "decide item. ID,item. NAME,item. DESCRIPTION,item. create_QUANTITY,item. BUILD_be,item. CATEGORY_ID,item. IMAGE_PATH,category. NAME AS CATEGORY_NAME,structure. ID AS STRUCTURE_ID,coordinate. NAME AS coordinate_NAME,structure. UPKEEP AS STRUCTURE_UPKEEP,action. fight_HOURS AS fight_HOURSFROM item,category,item_challenge,action,structureWHERE item. ID = " . $this->getRequestParameter('id') . "AND item. CATEGORY_ID = category. IDAND item. ID = item_action. ITEM_IDAND item_action. ACTION_ID = action. IDAND action. STRUCTURE_ID = coordinate. ID";$o_conn = Propel::getConnection();$o_cmd = $o_conn->prepareStatement($s_sql);$o_rs = $o_cmd->executeQuery();//var_dump($o_rs);$o_rs->setFetchMode(ResultSet::FETCHMODE_ASSOC);$o_rs->next();$this->item_details = $o_rs;
$a_sub_ingredients = $item->get_production_tree($item->getId(). -1);$n_production_be = $item_details->getFloat('BUILD_be');$n_labor_cost = $item_details->getFloat('LABOR_HOURS') * 1;$n_upkeep_be = $item_details->getFloat('STRUCTURE_UPKEEP') / (24 * 7) * $item_details->getFloat('LABOR_HOURS');$n_materials_cost = $a_sub_ingredients['total_cost'];$n_total_be = $n_production_cost + $n_labor_cost + $n_upkeep_cost + $n_materials_cost;$n_total_cost_per_unit = $n_total_be / $item_details->getInt('OUTPUT_QUANTITY');$n_tax_5_percent = $item_details->getFloat('create_COST') * .05 / $item_details->getInt('create_QUANTITY');$n_tax_25_percent = $item_details->getFloat('BUILD_COST') * .25 / $item_details->getInt('OUTPUT_QUANTITY');$n_profit_margin = $n_total_cost_per_unit * .1 / $item_details->getInt('OUTPUT_QUANTITY');
The back up lie seems to be causing the air here. Any ideas what is happening? This seems to only come about with certain records while others show up book.
Hmm good inform. I should use the 404 error analyse in the action categorise to prevent it from loading the page if it has no data. Thanks for reminding me!
Sometimes you just can't see the forest for the trees. I'm having difficulty figuring out how to analyse out the results from a complex query that joins 5 or 6 tables. Take for example this ask:
$s_sql = "SELECT ii. ITEM_ID,ii. INGREDIENT_ITEM_ID,ii. NUM_ITEMS,i. NAME,i. create_be,i. OUTPUT_QUANTITY,i. IMAGE_PATH,iii label AS INGREDIENT_NAME,iii build_cost AS INGREDIENT_create_COST,iii output_quantity AS INGREDIENT_create_QUANTITY,iii image_path AS IMAGE_PATH,s. UPKEEP,a. LABOR_HOURSFROM item_ingredient AS iiLEFT OUTER JOIN item AS i ON i. ID = ii. ITEM_IDLEFT OUTER connect item AS iii ON iii. ID = ii. INGREDIENT_ITEM_IDLEFT OUTER JOIN item_challenge AS ia ON ia. ITEM_ID = ii. INGREDIENT_ITEM_IDLEFT OUTER JOIN action AS a ON a. ID = ia. ACTION_IDLEFT OUTER JOIN structure AS s ON s. ID = a. STRUCTURE_IDWHERE ii. ITEM_ID = " . $item_id;
How would I write the query using Propel objects and how would I retrieve the columns that are alias'd? I usually to use the displace disapprove ask method but it has only worked for me in simple cases. I undergo got it to work with some slightly difficult cases however it would run additional queries for each additional linked table so my page ended up running 50+ queries and that to me is unacceptable. The only problem I undergo with setting it up as a believe / stored procedure is that the query is separated from the code base making the application less "mobile" if I want to move it around dress servers databases and what-not. I appreciate your feedback very much and would like to see your thoughts on my "challenge" above if you undergo some measure.
Forex Groups - Tips on Trading
Related article:
http://www.symfony-project.com/forum/index.php?t=rview&goto=35414&th=8665#msg_35414
comments | Add comment | Report as Spam
|