Home  >  Article  >  Backend Development  >  怎么创建上传图像的数据库表,用什么类型来存储

怎么创建上传图像的数据库表,用什么类型来存储

WBOY
WBOYOriginal
2016-06-06 20:51:391681browse

怎么创建上传图像的数据库表,用什么类型来存储?还有就是要不要单独创建一个表来存储上传图像,还是直接在信息表里再添加字段来存储图像?

回复内容:

怎么创建上传图像的数据库表,用什么类型来存储?还有就是要不要单独创建一个表来存储上传图像,还是直接在信息表里再添加字段来存储图像?

字段类型用二进制,一般叫BLOB

不过比如sqlite,里面存二进制会大幅增加footprint,一般做法是图片存为物理文件,数据库里存路径

Statement:
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