I'm trying to give an div a background image that is attached to a specific post (zo everytime there is another image needed). I'm retrieving the URLS out of the database and then put it into the following code:
<div class="parallax_banner" style="background-image:url(<?= "_/".$rowImage['imgPath']."/".$rowImage['imgName'] ?>)"></div>
the whole code:
<?
$result = mysql_query("SELECT * FROM `items` WHERE `itemID` = ".$_GET['postID'])or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
$resultImage = mysql_query("SELECT * FROM `images` WHERE `itemID` =".$row['itemID']." LIMIT 1")or die(mysql_error());
while ($rowImage = mysql_fetch_assoc($resultImage)) {
?>
<div class="paginaBannerWrapper">
<div class="paginaBannerSlideshow">
<div class="parallax_banner" style="background-image:url(<?= "_/".$rowImage['imgPath']."/".$rowImage['imgName'] ?>)"></div>
</div>
</div>
<div id="content">
<div id="bigTitle">
<h1><?=$row['itemTitle']?></h1>
</div>
<div id="centerContent">
<div id="colDesc">
<div class="itemContent"><?=$row['itemContent']?></div>
</div>
<div id="colImg"><img src="<?= "_/".$rowImage['imgPath']."/".$rowImage['imgName'] ?>"/></div>
<?
}
}
?>
</div>
</div>
It's doesn't show anything, but If I test the link with <img src=
instead of background-image:url()
it shows up. So the path is right. How to solve this?