Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 3
    First time echo $prev; is undefined. You should check it if(isset($prev)) echo $prev; Commented Jan 14, 2018 at 9:14
  • 1
    You would have to echo once more outside of the loop for the final item. Commented Jan 14, 2018 at 10:00
  • @Matt Yes, If he needs, he should, I just consider the previous data part Commented Jan 14, 2018 at 10:03
  • @Sohel0415, I have tried and it worked fine .. thank you Commented Jan 14, 2018 at 13:25