PDA

View Full Version : [PHP] Display Across Page



Shibby-Shabs
06-10-2010, 12:00 PM
Ok I'm getting urls from my database and displaying them on the page but the only way I know how is across or down and I was wondering if anybody knew how to display the images like


1 2
3 4
instead of
1234 or
1
2
3
4

here's my code:

// Display Data
$get = mysql_query("SELECT * FROM pictures LIMIT $start, $per_page");
while ($row = mysql_fetch_assoc($get))
{
// Get Data
$url = $row['url'];
$name = $row['name'];
echo "<img src='$url' width='100px' height='100px' alt='$name' border='1'><br />";
}
Note, Connecting data wasn't added in.

LMS16
06-10-2010, 01:09 PM
Create a div with a set width so that the images move to the bottom after they reach the edge? :)

Lew.

Shibby-Shabs
06-10-2010, 01:38 PM
Oh.. Sounds about right, I'll give this a try, Would it be like this, and this is roughly off the top off my head, html only too.




<div id='example' style='width:250px;'>
<img scr='lol.png' width='100px' height='100px'>
</div>

LMS16
06-10-2010, 02:28 PM
Yeah, that sounds about right :)

Lew.

Want to hide these adverts? Register an account for free!