PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
toasty525
Forum Newbie
Posts: 10 Joined: Wed Apr 05, 2006 12:48 pm
Post
by toasty525 » Thu Apr 13, 2006 5:47 pm
Hi, im trying to display pictures side by side in a table with the picture owners name above them using the following code:
Code: Select all
$tmp=mysql_query("SELECT id,fname,pic1 FROM ".C_MYSQL_MEMBERS." WHERE fname = '".$link."' AND pic1 <> 0 limit 1");
while($i=mysql_fetch_array($tmp)) {
$name = (trim($i['fname']) == '') ? $i['id'] : $i['fname'];
$pic = ($i['pic1']); ?>
<a href="view.php?l=<?=$l;?>&id=<?=$i['id'];?>"><b><?=$name;?></b></a>
<a href="../view.php?l=<?=$l;?>&id=<?=$i['id'];?>"><img src=/members/uploads/<?="$pic";?> border="0" width="100"></a><? }}
?>
It displays the pictures fine but the names are along side the pictures instead of above any ideas why this is happening ? thanks, mark.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Apr 13, 2006 5:51 pm
Add a <br> after the first anchor?
toasty525
Forum Newbie
Posts: 10 Joined: Wed Apr 05, 2006 12:48 pm
Post
by toasty525 » Thu Apr 13, 2006 5:59 pm
Adding a <br> puts the names above the pictures but also makes the pictures display one above the other instead of my desired effect wich is to have the pictures display along side one another.
toasty525
Forum Newbie
Posts: 10 Joined: Wed Apr 05, 2006 12:48 pm
Post
by toasty525 » Sun Apr 16, 2006 9:27 am
Thanks for the link Ambush Commander it done the job perfectly, nice article.