Need Help for while loop

Discussion in 'PHP' started by shanee, Oct 25, 2007.

  1. #1
    Hello to all,
    i have coded simple myql statment and loop for my upcoming wallpapers site. which is below

    <?php
    
    		                $sql = "select wallpaperid, title, date, rating from wallpaper order by downloads desc limit 0,10";
    
    		                $result = mysql_query($sql ,$db);
    
    						if ($myrow = mysql_fetch_array($result)) {
    
    						   do {
    
    						      if ($rowcolor == 1) {
    						     
    						      
    						      printf("<table width='200px' cellspacing='0' cellpadding='0'>
      <tr>
        <td><img src='%s'/></td>
      </tr>
    </table>", $myrow["wallpaperid"]);
    
    
                               } while ($myrow = mysql_fetch_array($result));
    
                            }
                         ?>
    PHP:
    its output is
    Image1
    Image2
    Image3
    Image4
    Image5
    Image6
    blah blah......

    can anyone tell me how i can get the below output

    Image1 Image2 Image3

    Image4 Image5 Image6
     
    shanee, Oct 25, 2007 IP
  2. kreoton

    kreoton Peon

    Messages:
    229
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    just change table to floating div :/
     
    kreoton, Oct 25, 2007 IP