Jump to content

I need some while loop help.


iStriide

Recommended Posts

I'm having a problem as you can see here http://www.halobattles.comyr.com/profile.php?player=iStriide, and i'm not sure on how to make it where it just lines up side-by-side. Here's the code:

<?php

$find_weapons = "SELECT * FROM weapons WHERE Username = '$player' ORDER BY Weapon_Level DESC";
$run_weapons = mysql_query($find_weapons);

echo "
<div class='weapons-list'>

<div class='profile-general-stats-heading'>
<h4>Weapons List</h4>
</div>
";

while($list = mysql_fetch_array($run_weapons)){

$weapon_name = $list['Weapon_Name'];
$weapon_image = $list['Weapon_Image'];
$weapon_level = $list['Weapon_Level'];

echo "
<table>
<tr>
<td align='middle'><img src='$weapon_image'/><br/>$weapon_name<br/>$weapon_level</td>
</tr>
</table>
";

}

echo"
</div>
";

?>

Link to comment
https://forums.phpfreaks.com/topic/244168-i-need-some-while-loop-help/
Share on other sites

Your problem is in the css.  you have set

.profile-general-stats-heading h4{
float: left;
font-size: 13px;
}

 

because of this you need to add a clear:left or clear:both to your .profile-general-stats table class. :

.profile-general-stats table{
width: 98%;
clear:left;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.