Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post

    3 column is broken

    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
    PHP Code:
          <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($percent1):$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

  • #2
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post
    /solved
    /close


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •