thenewprogrammer
New Member
- Messages
- 45
- Reaction score
- 0
- Points
- 0
Making a virtual pet site for fun but the shop items when i output them the price goes to the side of it instead of underneath it. looking for a way to output the price underneath the picture instead of to the side of it.
Code:
<style type="text/css">
li{display:inline}
</style>
<ul>
<?php
$dbhost = "localhost";
$dbname = "*****";
$dbuser = "*****";
$dbpass = "****";
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$query2 = "SELECT * FROM game WHERE item_type = 'food' ORDER BY RAND() LIMIT 5";
$result = mysql_query($query2);
while($row = mysql_fetch_assoc($result)){
$image = $row["item_img"];
$desc = $row["item_desc"];
$cost = $row["item_cost"];
echo '<li><img src="Images/items/'. $image . '.png" alt='. $desc . ' /></li>';
echo '<li>Cost: '. $cost . '<li>';
}
?>
</ul>
Last edited: