Home > Database > Mysql Tutorial > mysql-图片存进数据库之后显示不出来

mysql-图片存进数据库之后显示不出来

WBOY
Release: 2016-06-06 09:33:16
Original
2599 people have browsed it

mysql图片

我用文件框上传图片

<code> <tr>
<td height="30">图片:</td>
<td>
<input type="file" name="photo" style="border-color:#66FFFF; outline:none;">    <input type="hidden" name="MAX_FILE_SIZE" value="10485760000000">
</td>
</tr></code>
Copy after login

在php里用$photo_path=$_FILES['photo']['tmp_name']来获取图片的路径,把路径存进MySQL。
但要显示图片的时候就不成功,我是这样显示图片的

<code> <img  src="<?php%20echo%20%24photo%5B'path'%5D;?>" alt="mysql-图片存进数据库之后显示不出来" ></code>
Copy after login

,$photo是select的结果再mysql_fetch_array的变量。
是不是图片的存进就已经有问题,譬如图片的路径是D:\wamp\www\sex\photo\2.jpg,但存进数据库里的路径是D:\wamp\tmp\phpFE3.tmp,怎么不一样的?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template