<?php $fn="G:\\myPhoto\\1.jpg"; $conn=mysql_connect('localhost','root','123'); if(!$conn) { die("fail".mysql_error()); } mysql_select_db('showpic'); mysql_query("set names utf8"); $fn=addslashes($fn); $fn=addslashes($fn); $query="insert into path values('$fn')"; mysql_query($query); $sql="select *from path"; $result=mysql_query($sql); $url=mysql_fetch_array($result,MYSQL_ASSOC); ?> <img src="<?php echo $url['filename']?>" /> <?php mysql_close($conn); ?>
用img标签为什么显示不出图片