我的图片保存路径已经有了
数据库中叫PicUrl/test/uploads/1340957340.jpg那我在前台怎么显示?
我现在是这样的
$sql = "select ProName,text,ProID,PicUrl from products where ProID=$id";
$query = mysql_query($sql);<?php echo '<image src="localhost:8080.'$query[PicUrl]'.">' ?> 我也觉得有错误,但是怎么改啊,高手指教
数据库中叫PicUrl/test/uploads/1340957340.jpg那我在前台怎么显示?
我现在是这样的
$sql = "select ProName,text,ProID,PicUrl from products where ProID=$id";
$query = mysql_query($sql);<?php echo '<image src="localhost:8080.'$query[PicUrl]'.">' ?> 我也觉得有错误,但是怎么改啊,高手指教
$row=mysql_fetch_assoc($query);
<?php echo '<image src="localhost:8080'.$row[PicUrl].'">' ?>
#在html中可直接:
<img src='localhost:8080<?=$row['PicUrl']?>' />
另,确定你的路径是正确的,查看页面源码
<img src='http://localhost:8080<?=$row['PicUrl']?>' />