Jump to content

Show Image from mysql in PHP


princeofpersia

Recommended Posts

Hi guys, I have page where it echos out the image url from mysql in a MAMP Server,

 

however when i echo the image url out it seems to be fine but as soon as i put in a img scr it wont show the image  but it shows the container.

 

I have the code here

<div id="maincontentholderbottom">

<div id="maincontentholderbottom-index-left">
<div id="news-container"><ul>

<?php
$select=mysql_query("SELECT * FROM news");
while($get_news=mysql_fetch_array($select)){
$newsid=$get_news['id'];	
$title=$get_news['title'];	
$text=$get_news['text'];
$newsdate=$get_news['date'];
$newstime=$get_news['time'];
$imagelink=$get_news['newsimagelink'];

$newstext=substr($text, 0, 420);



echo"<li><div id='title'>$title</div><div id='newsblock'>$newstext... <a href='http://localhost/mycomputer/create/news/index.php?id=$newsid'>Read More</a></div>
<div id='newsimage'><img src='$imagelink' width='150' height='70'/></div>

</li>";

}

?>
</ul>

</div>
</div>
</div>

 

 

Do u know why is it like this? I appreciate your help in advance.

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/246710-show-image-from-mysql-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.