user2393653
user2393653

Reputation: 1

Loading picture from database to jquery slider using php

I am trying to load pictures from database to jquery slider infact what is stored at database is the name of the picture

i implemented this code, it's working without errors but it showing me nothing at slider all is empty

<div id="slider">
<?php
    while ($result = mysqli_fetch_object($banner)):
?>
    <img src="images/banner/<? $banner['picture'];?>/" width="950" height="400"alt=""      title="<strong><? echo $banner['title'];?></strong><span><? echo $banner['description'];?>    </span>" />
<?php
endwhile
?>
</div>

name of the table at database is banner in which i have id(INT), picture(varchar 50) title(varchar(100), description(longblob)

query is working and returning number of selected rows but nothing is shown

Upvotes: 0

Views: 1319

Answers (1)

ɴᴀᴛᴇ ᴅᴇᴠ
ɴᴀᴛᴇ ᴅᴇᴠ

Reputation: 4611

You need to echo the result rather than just use the variable...

<div id="slider">
<?php
    while ($result = mysqli_fetch_object($banner)):
?>
    <img src="images/banner/<?php echo $banner['picture'];?>" width="950" height="400" alt="" title="<strong><? echo $banner['title'];?></strong><span><?php echo $banner['description'];?></span>" />
<?php
endwhile;
?>
</div>

Upvotes: 2

Related Questions