I have a sql query that is returning me rows like this:
ID | Code | Numb
1 | 1 | 1
2 | 2 | 2
3 | 3 | 3
and I am trying to write foreach loop that will always show the previous values.
My normal foreach loop like this:
foreach($array as $key => $val) {
echo '$val['code'];
}
how can i make the value to always be from the previous row?