Page 1 of 1

cant get user names to display at top of picture

Posted: Thu Apr 13, 2006 5:47 pm
by toasty525
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.

Posted: Thu Apr 13, 2006 5:51 pm
by feyd
Add a <br> after the first anchor?

Posted: Thu Apr 13, 2006 5:59 pm
by toasty525
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.

Posted: Thu Apr 13, 2006 7:33 pm
by Ambush Commander

Posted: Sun Apr 16, 2006 9:27 am
by toasty525
Thanks for the link Ambush Commander it done the job perfectly, nice article. :)