Home > Backend Development > PHP Tutorial > !PHP如何把数据库的多个图片显示出来

!PHP如何把数据库的多个图片显示出来

WBOY
Release: 2016-06-13 10:14:16
Original
1087 people have browsed it

求救!!PHP怎么把数据库的多个图片显示出来
如题。我已经把图片存进数据库里了。。现在我怎么把这些图片显示到页面中。

------解决方案--------------------
传递 id ,一次一个
------解决方案--------------------
对了,如果你php版本是5.3以后,还要小心notice级别的错误 $row['filetype'].
读取图片就不能有别的输出,包括php的报错。
------解决方案--------------------
如果是 window 环境,那么图片数据已经损坏了
fopen($_FILES[ 'photo'][ 'tmp_name'],"r")
要写作
fopen($_FILES[ 'photo'][ 'tmp_name'],"rb")

写成这样就安全了
$data = addslashes(file_get_contents($_FILES[ 'photo'][ 'tmp_name'])); 

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