sandbudd Posted December 5, 2009 Share Posted December 5, 2009 Hey guys it displays the image great and does the hyperlink but shows http:/// instead of the link that is in the database? <?php echo '<a href="' . $row['headerlink'] . '" target="_blank" border="0">'; echo "<img width='940px' height='165px' src= images/".$row['header'] ."> "; ?> Link to comment https://forums.phpfreaks.com/topic/184083-not-showing-link-in-the-database/ Share on other sites More sharing options...
trq Posted December 5, 2009 Share Posted December 5, 2009 There is nothing syntactically wrong with the code you have posted. Where is $row defined? Link to comment https://forums.phpfreaks.com/topic/184083-not-showing-link-in-the-database/#findComment-972106 Share on other sites More sharing options...
sandbudd Posted December 6, 2009 Author Share Posted December 6, 2009 here is the complete file and like I said it displays the image fine just not the link? <? // Connect database. $host=""; // Host name. $db_user=""; // MySQL username. $db_password=""; // MySQL password. $database=""; // Database name. mysql_connect($host,$db_user,$db_password); mysql_select_db($database); $result=mysql_query("select * from ads WHERE id='1'"); ?> <?php // Fetch record rows in $result by while loop and put them into $row. while($row=mysql_fetch_assoc($result)){ ?> <?php echo '<a href="' . $row['headerlink'] . '" target="_blank" border="0">'; echo "<img width='940px' height='165px' src=http://www.sandbuddcustomdesigns.com/Musa/uploader/images/".$row['header'] ."> "; ?></a> <?php } // End while loop. ?> Link to comment https://forums.phpfreaks.com/topic/184083-not-showing-link-in-the-database/#findComment-972171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.