数据库"content"<IMG src="/webfiles/uploadfile/20110424101725400.jpg" border=0>
<?php   
$exectop1="select * from news2 order by id desc limit 1"; 
$resulttop1=mysql_query($exectop1);   
$a=1; 
while($rstop1=mysql_fetch_object($resulttop1))  

?>
$strtop1= <?php echo "$rstop1->content";?>
$arr = explode('"',$strtop1);
$newpic = $arr[1];<img src="$newpic" width="100" height="80" />

解决方案 »

  1.   

    <?php   
    $exectop1="select * from news2 order by id desc limit 1";  
    $resulttop1=mysql_query($exectop1);   
    $a=1; 
    while($rstop1=mysql_fetch_object($resulttop1))   

    $strtop1= $rstop1->content";
    $arr = explode('"',$strtop1);
    $newpic = $arr[1];
    }
    <img src="<?php echo $newpic; ?>" width="100" height="80" />
      

  2.   

    <?php   
    $exectop1="select * from news2 order by id desc limit 1";  
    $resulttop1=mysql_query($exectop1);   
    $a=1; 
    while($rstop1=mysql_fetch_object($resulttop1))   

    $strtop1= $rstop1->content";
    $arr = explode('"',$strtop1);
    $newpic = $arr[1];
    }
    ?>
    <img src="<?php echo $newpic; ?>" width="100" height="80" />
      

  3.   

    谢谢楼上,试了几遍,发现少了引号,加上了测试通过~$strtop1= "$rstop1->content";