Home > Database > Mysql Tutorial > 在MySQL中存储图象的步骤[组图]_MySQL

在MySQL中存储图象的步骤[组图]_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:53:17
Original
1002 people have browsed it

MySQL中存放图像应该用Blob类型的数据类型。参考步骤如下:

1. 生成一个基本的表Images来存放图片

create table Images (PicNum int not null auto_increment primary key, image BLOB);

2. 建立上载脚本,完成的功能是取得图片文件并把文件插入数据库,假定放文件名的列是Picture脚本见下图(点击放大)

在MySQL中存储图象的步骤[组图]_MySQL 

3. 以上脚本可能会出现无法插入的报错信息,请参考MySQL的max packet allowed设置,在错误日志中可以查到。

4. 以下的脚本将显示出插入的图片

在MySQL中存储图象的步骤[组图]_MySQL

Related labels:
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