[eluser]superfake123[/eluser]
Hello,
using the active records or any other database function is there a way to do an if statement to see if you are on the last row in the result yet or not? Basically I want to add a comma to all lines except the last one... something like this:
Code:
<?php foreach($images->result() as $image): ?>
{image:'images/gallery/'.$id.'/<?php echo $image->file; ?>', thumb: 'images/gallery/'.$id.'/thumbs/<?php echo $image->file; ?>'}<?php if ($images->current_row() < $images->num_rows()): ?>,<?php endif; ?>
<?php endforeach; ?>
I can't find anything that will say current row though. do I gotta make the code ugly and add in a counter/ do it myself???