Hi,
I’m trying to return a set of results back so I can output them in a graph plotter.
The results for a question in this instance will be 0,1,2,3,4,5 or 6 I want to count these and plot them out on a graph.
So far I’m using the below but it doesn’t seem to output as required. Any ideas on another solution?
function getResultsforColleagueQuestion($q, $id) {
$db = db::getInstance();
if ($result = $db->query("SELECT `cq_q1_".$q."` FROM `collegue_questionaire` WHERE `cq_question_number` = 7 AND `cq_user_id` ='" . $id . "'")) {
if ($rows = $db->getrows($result)) {
return array_count_values($rows[1]);
}
}
}