Hi,
I am looping the data and displaying it from the database. But only one data set is displaying in the loop. I dont now where i am doing wrong. Here is my code. Please help me
$resultViewed = $this->model_report_product->getMostViewed();
$stringResult ="var data= google.visualization.arrayToDataTable([ ['Product', 'Views'],";
foreach($resultViewed as $results)
{
$stringResult = $stringResult . "['".$results['name']."',".$results['quantity']."],";
}
$stringResult .= "]);";
$this->data['Viewed'] = $stringResult;