Jump to content

How to display image in row wise


rajmohan

Recommended Posts

take a look at this one..

 

// code by Barand
define ("NUMCOLS",3);

$res = mysql_query("SELECT name, cover FROM movies");

$count = 0;
echo "<TABLE>";
while (list($name, $cover) = mysql_fetch_row($res)) {

    if ($count % NUMCOLS == 0) echo "<TR>\n";  # new row

    echo "<TD>$name<br>$cover</TD>\n";
    $count++;

    if ($count % NUMCOLS == 0) echo "</TR>\n";  # end row
}

# end row if not already ended

if ($count % NUMCOLS != 0) {
   while ($count++ % NUMCOLS) echo "<td> </td>";
   echo "</TR>\n";
}
echo "</TABLE>";

 

edit it to you needs and you are set...

 

nita

Archived

This topic is now archived and is closed to further replies.

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