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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.