Hi:
I'm populating the results of a db query into a javascript object.
Something like this:
foreach($query2->result() as $row2):
{name:"<?= $row2->SongTitle?>",Download:"<?= $row2->full_download?>", free:false},
endforeach
The problem is that the last entry from the query has a comma at the end, which throws a js error.
What I need is to have the comma at the end of each result EXCEPT the last one.
I have a counter:
$counter = count($query2->result());
and I'm thinking I need a while or do-while loop within the foreach, but not sure how to implement it....
Any ideas?
Thanks
Kamy