Jump to content

JTxx

New Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by JTxx

  1. First of all, please help!  :)

     

    Ok so im trying to create a table of 4 columns and 3 rows with each cell holding a random hyperlinked picture.

    Below is my code.

     

     

    <?php

    include ("connection.php");

     

    $query = "SELECT * FROM games ORDER BY Rand() LIMIT 3";

     

    $result = mysql_query($query);

     

    print "<table border=1>";

    while($row = mysql_fetch_array($result)) {

    print "<tr>";

    print "<td><a href=pregame.php?id=".$row['GameId']."><img src=images/".$row['Thumb']." alt=Image width=100 height=76 class=gamepic/></a></td>";

    print "<td><a href=pregame.php?id=".$row['GameId']."><img src=images/".$row['Thumb']." alt=Image width=100 height=76 class=gamepic/></a></td>";

    print "<td><a href=pregame.php?id=".$row['GameId']."><img src=images/".$row['Thumb']." alt=Image width=100 height=76 class=gamepic/></a></td>";

    print "<td><a href=pregame.php?id=".$row['GameId']."><img src=images/".$row['Thumb']." alt=Image width=100 height=76 class=gamepic/></a></td>";

    print "</tr>";

    }

    print "</table>";

    ?>

     

     

    The problem is that its printing the same hyperlinked picture in each 4 cells of a row.

×
×
  • 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.