akumakeenta Posted March 7, 2010 Share Posted March 7, 2010 Hi all again, I have a script that will process all images and place them all in one row. What I need help with is, to place to 2 images in one row and then start a new row and place two more images etc. Here is the code: <table cellpadding="5" class="adpics" width="100%" border="0"> <tr> <?php while ($row = mysql_fetch_array($pres)) { $i++; $imgsize = GetThumbnailSize("{$datadir[adpics]}/{$row[picfile]}", $images_max_width, $images_max_height); ?> <td> <img src="<?php echo "{$datadir[adpics]}/{$row[picfile]}"; ?>" id="adimg<?php echo $i; ?>" width="<?php echo $imgsize[0]; ?>" height="<?php echo $imgsize[1]; ?>"> </td> <?php } ?> </tr> </table> thanks again for your help. Quote Link to comment Share on other sites More sharing options...
trq Posted March 7, 2010 Share Posted March 7, 2010 See here. Quote Link to comment Share on other sites More sharing options...
akumakeenta Posted March 7, 2010 Author Share Posted March 7, 2010 Thanks I hope i can figure it out...I was just hoping for someone to just say type this....lol Quote Link to comment Share on other sites More sharing options...
vividona Posted March 7, 2010 Share Posted March 7, 2010 $count = 1; $column = 1; echo '<table cellpadding="5" class="adpics" width="100%" border="0">'; while ($row = mysql_fetch_array($pres)) { if ($column == 1){ echo "<tr> <td>".$imgsize = GetThumbnailSize("{$datadir[adpics]}/{$row[picfile]}", $images_max_width, $images_max_height)."</td>"; }else{ echo "<td>".$imgsize = GetThumbnailSize("{$datadir[adpics]}/{$row[picfile]}", $images_max_width, $images_max_height)."</td>";("<td></tr>"; } } $count += 1; $column = $count % 2; Quote Link to comment Share on other sites More sharing options...
trq Posted March 7, 2010 Share Posted March 7, 2010 Thanks I hope i can figure it out...I was just hoping for someone to just say type this....lol That's pretty much what that mini tutorial does, and you get to learn how its done. Save you coming back again latter and asking the same question. Quote Link to comment Share on other sites More sharing options...
akumakeenta Posted March 7, 2010 Author Share Posted March 7, 2010 I tried to write it myself by the link you sent me to but I didn't work. I didn't get any errors which is a win in my book. LOL but I will try Vividona's suggestion. Thanks all. I'll keep you posted. Quote Link to comment 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.