I am trying to get the sum of available values of all rows what a column contains. using SQL query from “commandline” it is working and getting the result but when I am trying to keep it in a PHP variable and show, it returns only 1 as a result! what the wrong I am doing?
public function getObMarks(){
$query = "SELECT SUM(obMarks) FROM ques_ans_marks";
$getMarks = $this->db->select($query);
$getObMarks = $getMarks->num_rows;
return $getObMarks;
}