Jump to content

[SOLVED] Images In Col.


fazee

Recommended Posts

I'm PHP new bie

 

I fetch successfully images from database in single row

 

Here is my code

 

 

$queryset=mysql_query("select * from pictures where setname='$setname'");
echo "<table id='setthumbs'>";
while($rowset = mysql_fetch_array($queryset)){
echo "<tr><td><a href='#' onclick=\"picchange('$rowset[id]')\"><img src='images/s-$rowset[id].jpg' ></a></td></tr>";

}
echo "</table>";

 

 

 

I want to a fetch images in 3 or 4 coloumn. What do I need to add in this code

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/139101-solved-images-in-col/
Share on other sites

$queryset=mysql_query("select * from pictures where setname='$setname'");
echo "<table id='setthumbs'>";
echo "<tr>";
while($rowset = mysql_fetch_array($queryset)){
   echo ($c % 3 == 0)? "</tr><tr>" : ""; 
   echo "<td><a href='#' onclick=\"picchange('$rowset[id]')\"><img src='images/s-$rowset[id].jpg' ></a></td>";
   $c++;
}
echo "</tr></table>";

Link to comment
https://forums.phpfreaks.com/topic/139101-solved-images-in-col/#findComment-727532
Share on other sites

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.