I'm having a problem getting IMG urls to load from the database into my script, when I look at the source in the browser, it shows <IMG SRC="Resource Id #3"> which means it's not extracting it from the database right, correct?
here is my php code I have:
<?
include("db.conf.php");
$getnewsshort = mysql_query("SELECT * FROM news order by id desc");
while($r = mysql_fetch_array($getnewsshort))
{
$id = $r["id"];
$title = $r["title"];
$shortdesc = $r["shortdesc"];
$poster = $r["poster"];
$approvedby = $r["approvedby"];
$comments = $r["comments"];
$date = $r["date"];
$isapproved = $r["isapproved"];
$postericon = mysql_query("SELECT icon FROM users where username='.$poster'");
//$icon = mysql_result($postericon);
if($isapproved = "Y"){
?>
<br><br>
<table width="95%" cellpadding=0 cellspacing=4 border=0><tr><td><a class="headlinetitle" href="news.php?id=<?echo $id;?>"><?echo $title;?></a></td></tr>
<tr><td><font size=1>posted by <a href="http://<?echo $poster;?>.gfx-online.com"><?echo $poster;?></a> on <?echo $date;?><span align="right">approved by <a href="http://<?echo $approvedby;?>.gfx-online.com"><?echo $approvedby;?></a> <img src="<?echo $postericon;?>"></td></tr>
<tr><td><font size=1><?echo $shortdesc;?></td></tr>
<tr><td><a href="news.php?id=<?echo $id;?>">(<?echo $comments;?>) comments on this article</a></td></tr></table>
<? }
else
{
echo "No News posts";
}
}?>
every user has an ICON field (default to "usericons/none.jpg").
it won't show up!!!
this is what it looks like in the browser source:
<table width="95%" cellpadding=0 cellspacing=4 border=0><tr><td><a class="headlinetitle" href="news.php?id=1">test</a></td></tr>
<tr><td><font size=1>posted by <a href="http://aeon.gfx-online.com">aeon</a> on 11/12/02<span align="right">approved by <a href="http://aeon.gfx-online.com">aeon</a> <img src="Resource id #3"></td></tr>
<tr><td><font size=1>test</td></tr>
<tr><td><a href="news.php?id=1">(0) comments on this article</a></td></tr></table>
any insight?