mhaey Posted July 7, 2007 Share Posted July 7, 2007 can anyone help me out about looping these images... i have 15 images stored in the database.. and i want them to retrieve 5 in a column.. and so on... only 5 in a column.. and the rest would be in the next row... like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <html> <head> <body> <table border=0 align="center" > <tr> <? mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("praktis")or die("cannot select DB"); $sqlcon = "select * from upload2"; $result = mysql_query($sqlcon); $row = mysql_fetch_array($result); $rst=mysql_query($sqlcon) or die('mali!!! lolz!!'); while ($row=mysql_fetch_array($rst)) { $name=$row[name]; $id=$row[id]; $path=$row[path]; echo '<td><a href="'.$path.'"><img src="'.$path.'" alt="'.$name.'" height="80" width="80"/></a></td>'; } ?> </tr> </table> </body> </head> </html> Quote Link to comment Share on other sites More sharing options...
Barand Posted July 7, 2007 Share Posted July 7, 2007 see http://www.phpfreaks.com/forums/index.php/topic,95426.0.html 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.