Welcome Guest, Not a member yet? Register   Sign In
next_row and previous_row not working
#1

[eluser]Unknown[/eluser]
I have the following code

Code:
<? $i=1; ?>
        <? foreach ($query4->result_array() as $row4): ?>
        
        <? $next = $query4->next_row('array'); ?>
        <? $prev = $query4->previous_row('array'); ?>

<? $i++; ?>
<? endforeach; ?>

However when I run this the next_row() and previous_row() functions only work on the first loop. So on the first run through they get the next row or previous row but then they seem to stop.

Then whenever I do a var_dump on the $next and $prev variables they still contain the data for the second row.

Does anyone know what I'm doing wrong?

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB