I have uploaded multiple images and path of all the images have been stored together.
Using explode
I have separated them and now I wish to echo them in a c
this is all the codes in the link:
CONNECT TO database with PDO:
PDO::ERRMODE_WARNING)); }
catch (PDOException $e){echo 'Database Server Goes Down or Not Available!';}
?>
then, fetch the images:
prepare("SELECT * FROM table_name WHERE item=:item ORDER BY id ASC LIMIT 4,8");
$queryz->execute();
$data = $queryz->fetchAll();
foreach ($data as $row){
$id=$row['id'];
$imagez=$row['imagez'];
?>
prepare("SELECT * FROM table_name WHERE item=:item ORDER BY RAND() LIMIT 4,8");
$queryz->execute();
$data = $queryz->fetchAll();
foreach ($data as $row){
$id=$row['id'];
$imagez=$row['imagez'];
?>
Then, you focus on how to fetch the image. the code is like in this following:
<
div class="item active">
prepare("SELECT * FROM table_name WHERE item=:item ORDER BY id ASC LIMIT 4,8");
$queryz->execute();
$data = $queryz->fetchAll();
foreach ($data as $row){
$id=$row['id'];
$imagez=$row['imagez'];
?>
The PATH OF THE IMAGES stored in:
$imagez=$row['imagez'];
which has the same directory with
../myimage/defaultimg.jpg"
Note: I'm so sorry for not expert in explanation, but that's I wrote the code in the web page. But, I suggest you to copy the code and change what you need to then try again.