function random()
{
$anketadb = $this->load->database('anketa',TRUE);
$br = $anketadb->count_all_results('anketadata');
$nmb = mt_rand(1,$br);
if ($nmb != 1){
$nmb = $nmb - 1;
}
$count = $anketadb->get('anketadata', 1, $nmb);
return $count;
}
Why this code when i echo it in View returns ERROR:
A PHP Error was encountered
Severity: 4096
Message: Object of class CI_DB_mysqli_result could not be converted to string
Filename: ankete/rezultatiankete.php
Line Number: 52