Round Posted November 7, 2006 Share Posted November 7, 2006 Hello all,I have an image that I want to display next to a link. I can't seem to get it to sit next to the link, it keeps displaying the image above the link.I can put the image as part of the link, which means they will display alongside one another, but I don't want this as it puts a box around the image to show that it is a link.How do I solve this? Heres what I have so far:-Which displays the image above the link.[code]<?php #connect to db $conn = @mysql_connect( "localhost", "dbusername", "dbpassword" ) or die( "Err:conn"); #select db $rs = @mysql_select_db( "dbname", $conn) or die( "ERR:Db"); #create query $sql = "Select * from course where userid = \"$userid\" "; #exe query $rs = mysql_query( $sql, $conn ) or die( "Could not execute Query"); while( $row = mysql_fetch_array($rs) ){ $list .="<img src=\"../images/list_course.gif\">"; $list .="<a href=\"http://ourweb/course/category.php?id=".$row["course"]."\">".$row["fullname"]."</a>"; }echo( $list ); ?>[/code]Even the following makes the image dispaly above link:-[code]while( $row = mysql_fetch_array($rs) ){ $list .="<img src=\"../images/list_course.gif\"><a href=\"http://ourweb/course/category.php?id=".$row["course"]."\">".$row["fullname"]."</a>"; }[/code]The following puts link box around image (ugly) but do display alongside each other:-[code]while( $row = mysql_fetch_array($rs) ){ $list .="<a href=\"http://ourweb/course/category.php?id=".$row["course"]."\"><img src=\"../images/list_course.gif\">".$row["fullname"]."</a>"; }[/code]Any Ideas?Many Thanks Link to comment https://forums.phpfreaks.com/topic/26433-image-alongside-a-link-solved/ Share on other sites More sharing options...
wwfc_barmy_army Posted November 7, 2006 Share Posted November 7, 2006 [quote author=Round link=topic=114121.msg464182#msg464182 date=1162899823]The following puts link box around image (ugly) but do display alongside each other:-[code]while( $row = mysql_fetch_array($rs) ){ $list .="<a href=\"http://ourweb/course/category.php?id=".$row["course"]."\"><img src=\"../images/list_course.gif\">".$row["fullname"]."</a>"; }[/code]Any Ideas?Many Thanks[/quote]To get around this one you could check out this:http://www.boutell.com/newfaq/creating/border.html Link to comment https://forums.phpfreaks.com/topic/26433-image-alongside-a-link-solved/#findComment-120875 Share on other sites More sharing options...
Round Posted November 7, 2006 Author Share Posted November 7, 2006 Awesome Cheers wwfc_barmy_army.Thats exectly what I wanted, Perfect.Cheers Link to comment https://forums.phpfreaks.com/topic/26433-image-alongside-a-link-solved/#findComment-120877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.