ladyslinger Posted August 23, 2012 Share Posted August 23, 2012 Looking for some php help. I have a php class file from an open source ticket db that contains a function that I wish to modify from eventum 2.3.1 Sounds simple enough right? Not for me. I'm looking to modify so that the column I want displays a particular value. Right now I have the code set to: function getIssuesByUser($prj_id) { $stmt = "SELECT iss_id, iss_summary, iss_prj_id, usr_full_name, sta_title, iss_sta_id, sta_color, fld_title, FROM ( " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue, " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue_user, " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "user, " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "custom_field ) LEFT JOIN " . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status ON iss_sta_id = sta_id WHERE iss_prj_id=" . Misc::escapeInteger($prj_id) . " AND iss_id=isu_iss_id AND isu_usr_id=usr_id HAVING fld_title = 'Close Date' ORDER BY usr_full_name"; $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC); if (PEAR::isError($res)) { Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__); return ""; } else { Time_Tracking::getTimeSpentByIssues($res); $issues = array(); for ($i = 0; $i < count($res); $i++) { $issues[$res[$i]['usr_full_name']][$res[$i]['iss_id']] = array( 'iss_summary' => $res[$i]['iss_summary'], 'sta_title' => $res[$i]['sta_title'], 'fld_title' => Date_Helper::getFormattedDate($res[$i]['fld_title']), 'status_color' => $res[$i]['sta_color'] ); } return $issues; } } Is there anything glaring that I did wrong? I'm still getting familar with PHP and mySQL. the fld_title is the part I changed...it's a column in my custom_field table (not my choice...) Quote Link to comment https://forums.phpfreaks.com/topic/267497-class-function-help/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.