fazee Posted January 1, 2009 Share Posted January 1, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/139101-solved-images-in-col/ Share on other sites More sharing options...
.josh Posted January 1, 2009 Share Posted January 1, 2009 $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>"; Quote Link to comment https://forums.phpfreaks.com/topic/139101-solved-images-in-col/#findComment-727532 Share on other sites More sharing options...
fazee Posted January 2, 2009 Author Share Posted January 2, 2009 Coooooooooooooooool Thanks Mate it's working fine Quote Link to comment https://forums.phpfreaks.com/topic/139101-solved-images-in-col/#findComment-727978 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.