使用我在数据库中的url的图像为背景图像

I'm designing a web page to show some commodity results (such Model, price, Comment) for every Commodity is a database and I call theme to show in each Commodity (it while be shown in a div) I wanna to set backgrounds for each div (it saved in database and every Commodity have one background-image) please tell me whats the true syntax for this div s for example I wrote this code:

<div class="commodities"> <style>.commodities{ background-image:<?php $Images[$i]?>}  </style>
<?php
    echo "Model:";
    echo $Models[$i];
    echo "<br><br>";
    echo "Price:&nbsp;&nbsp;&nbsp;";
    echo $Prices[$i];
    echo "<br><br>";
    echo $Comments[$i];

?>
</div>

please help me to fix this part of code: { background-image:}

You have to do this:

    <div class="commodities" style="background-image: url('<?php $Images[$i]?>');">
<?php
    echo "Model:";
    echo $Models[$i];
    echo "<br><br>";
    echo "Price:&nbsp;&nbsp;&nbsp;";
    echo $Prices[$i];
    echo "<br><br>";
    echo $Comments[$i];

?>
</div>

If you put < style > tags in the < body > (put it on the < head > tags) you are doing nothing ;)

Instead use style property. ;)

Apart you are forgetting to use url tag on the background-image property. ;)

use inline css.

<div style="background-image: url(<?php echo $variable_name; ?>);">

or use internal css.

<style type="text/css">
.logo {
background: #FFF url(<?php echo $variable_name; ?>);
}
</style>