Jump to content


displaying from database..


1 reply to this topic

#1 er0x

    Young Padawan

  • Members
  • Pip
  • 43 posts

Posted 10 June 2009 - 05:05 PM

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

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!

Edited by er0x, 10 June 2009 - 05:09 PM.


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 10 June 2009 - 10:00 PM

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.pixel2lif...showtopic=15327





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users