Help - Search - Members - Calendar
Full Version: displaying from database..
Pixel2Life Forum > Help Section > PHP, ASP, MySQL, JavaScript and other Web/Database Programming Help
er0x
ok... i know about half of what im doing but there is just one little thing i am not figuring out here. what im trying to do is pull items from a database... which i am doing correctly but i need them to be listed a certain way which i am not doing so good at. I need them to be in rows of 2 without using tables (well preferably) but im not quite sure what i need to do css wise and php wise to do that... heres a layout of what i need

|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----this is a thumb pic---------|-|---this is a thumb pic-----------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
|-----------------------------------|-|----------------------------------|
thumb1 text blah blah----------------------thumb2 text blah blah

then below those it would go on to rows of 3 and 4, 5 and 6, etc...

all i have atm is

CODE
while($r=mysql_fetch_array($result))
{
    echo "<img src=\"$r[thumb]\"></img><br />test";
}


because i was gonna do 1 per row but the thumbs are too big and it just looks bad. so any help on how to do this? I guess i need the css for it so i can use divs but im not too great with that as i havent done a site in a year or so so im rusty and what do i need to add to the php?

any help greatly appreciated!
rc69
Since you're displaying data in a tabular format, you may as well use a table, it doesn't hurt anything. If you simply want to use divs to test your knowledge of CSS, go ahead, you're only using 2 columns, so it shouldn't be too hard.

Until then, you can read through the following post and see if it clears anything up. If not, feel free to ask for clarification.
http://www.pixel2life.com/forums/index.php?showtopic=15327
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.