Skip to content
Advertisement

foreach slider only shows one db entry

I’ve got an array which gets all the testimonials from the database table and displays them via a foreach array. I want some kind of a slider which fades-in and fades-out the results.

This is my query:

JavaScript

My PHP foreach code:

JavaScript

My piece of Javascript code

JavaScript

It’s currently only showing ONE (the latest in the database) and only fades-in and out that one. It does not show the other testimonials.

Advertisement

Answer

The problem is you are updating $row inside the loop

JavaScript

change it to

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement