i do have image table like this id image 1 cat.jpg 2 dog.jpg 3 apple.jpg 4 duck.jpg 5 tea.jpg 6 eye.jpg now what i want is i wanna display those images in column n row wise(there may be more than that datas), can anybody please help me out... i want to display like this cat.jpg dog.jpg apple.jpg duck.jpg tea.jpg eye.jpg Please help me out guys... my code is here but it displays in 1 column only.... <? include 'connect.php'; $wp = mysql_query("SELECT * FROM wallpapers order by id asc limit 6"); while($row = mysql_fetch_array($wp)){ $id = $row["id"]; $thumb = $row["thumb"]; echo "<table>"; echo "<tr>"; echo "<td><img src=\"wallpapers/thumb/$thumb\" width=\"120\" height=\"90\"></td>"; echo "</tr>"; echo "</table>"; } ?>
hi <? include 'connect.php'; $wp = mysql_query("SELECT * FROM wallpapers order by id asc limit 6"); while($row = mysql_fetch_array($wp)){ $id = $row["id"]; $thumb = $row["thumb"]; echo "<table>"; echo "<tr>"; echo "<td><img src=\"wallpapers/thumb/$thumb\" width=\"120\" height=\"90\"></td>"; echo "</tr>"; echo "</table>"; } ?> Code (markup): use following code <? include 'connect.php'; $wp = mysql_query("SELECT * FROM wallpapers order by id asc limit 6"); echo "<table>"; echo "<tr>"; $counter = 1; while($row = mysql_fetch_array($wp)) { $id = $row["id"]; $thumb = $row["thumb"]; echo "<td><img src=\"wallpapers/thumb/$thumb\" width=\"120\" height=\"90\"></td>"; if ($counter==5) { echo "</tr><tr>"; $counter = 0; } $counter++; } echo "</tr>"; echo "</table>"; ?> PHP:
yeah thats exactly what i was looking for thanks dude AND it would be more better If you add the code for like PAGINATION ( Previous- Next) can you please do that for me??