...

View Full Version : 3 column is broken



Vernk
06-12-2012, 06:18 AM
Hey so after I added in the Onsale products which are grabbed from a Database I had to create a while loop:
As you can see here : http://accountvendors.com
The 3 accounts on the home page aren't in 1 column the last one goes to the bottom and if I keep adding more into the DB it just becomes 2 in a column every time.
As you can see here: http://www.fruitblu.com/oxo/
It has 3 per row.
Here is the PHP code. for the looping

<div class="catrow">
<ul>
<?php
$data4 = mysql_query("SELECT * FROM onsale");
$num_rows_onsale = mysql_num_rows($data4);
if ($num_rows_onsale = 0) {
echo 'No accounts are On-sale please check later, sorry!';
} else {
while ($row4 = mysql_fetch_array($data4)) {
if ($row4[4] == 'true') {
if ($row4[7] == 'true') {
echo '<li>';
}
echo '<li class="new">';
} else {
echo '<li>';
}

echo '<div class="catThum">';
if ($row4[7] == 'true') {
echo '<img src="images/ranks/sold.png" style="width:100%; height:100%;" alt="" />';
} else {
echo '<a href="'.$row4[6].'"><img src="'.$row4[5].'" style="width:100%; height:100%;" alt="" /></a> ';
}
if ($row4[4] == 'true') {
if ($row4[7] == 'true') {
echo '';
} else {
echo '<div class="new"></div>';
}
}
echo '</div>';
echo '<div class="catDetail">';
if ($row4[7] == 'true') {
echo '<h4>'.$row4[1].'</h4>';
} else {
echo '<h4><a href="'.$row4[6].'">'.$row4[1].'</a></h4>';
}
$percent = ($row4[2] - $row4[3]) * (100 / $row4[3]);
$percent = round($percent);
//$percent = str_replace("-","");
echo '<p><s>$'.$row4[3].'</s> $'.$row4[2].' ('.($percent < 0?substr($percent, 1):$percent).'% off)</p>';
echo '</div>';
echo '</li>';

}
}
?>
</ul>
<div class="clr"></div>
</div>
<div class="catrow">
<ul>

</ul>
<div class="clr"></div>
</div>

This could be a CSS/HTML issue but I've been trying to fix for many hours.
Help would be amazingly appreciated!
Thanks in advanced

Vernk
06-12-2012, 09:37 AM
/solved
/close



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum