Skip to content
Advertisement

Loading images to Bootstrap carousel from a MySQL database using PDO (fetchall problem)

I’m using PDO to insert images from a database to a Bootstrap carousel. By that I mean ( loading The image path ), but the problem is when I use fetchall(); or fetch I get all rows value like this:

JavaScript

The output is: Efexor.jpg path upload/17.jpg upload/17.jpg upload/19.jpg upload/18.jpg upload/18.jpg* that is all rows from imageurl column, so when I loop foreach ($result) to load images from database to a Bootstrap carousel. It dose’t work

JavaScript

Advertisement

Answer

Try like this:

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