latest pics in 3 rows

Discussion in 'PHP' started by s4salman, Oct 31, 2007.

  1. #1
    I m using this code to show latest 4 pictures from mysql database.:

    <?php
    echo "<table border=\"0\" width=\"100%\" align=\"center\">"; 
    include "mysql.php";
    {
    mysql_connect($host, $username, $password) or die(); 
    mysql_select_db("$databasename") or die();
    $result=mysql_query("SELECT * from mus_img ORDER BY imgid DESC LIMIT 10");
    $numrows = mysql_num_rows($result);
    while ($results = mysql_fetch_array($result))
    {
    $imgid=$results['imgid'];
    $imgname=$results['imgname'];
    $imgtum=$results['imgtum'];
    echo "<td width=\"25%\" height=\"1\" align=\"center\"><a href=\"img.php?imgid=$imgid&count=1\"><img src=\"$imgtum\" alt=\"$imgname\"></a></td>";	
    }
    }
    echo "</table>";
    ?>
    PHP:
    Now i want to show 12 pics in 3 rows.Means 4 pics in ach row.
    Any one can help me.
     
    s4salman, Oct 31, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. Funk-woo10

    Funk-woo10 Peon

    Messages:
    1,108
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This may sound stupid, but how do you get more then 1 result.

    For example I put Limit 10 and the end of the query but it only displays 1 result.

    Any1 got any examples ?
     
    Funk-woo10, Oct 31, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    Post your code, but please create your own topic for this.

    Let's not hijack this one.
     
    nico_swd, Oct 31, 2007 IP