cn我们如何使用查询将图像存储在数据库中 [英] how cn we store images in database using queries
本文介绍了cn我们如何使用查询将图像存储在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
给我一个示例查询,我们能否给出已经存在的图像名称
give me a sample query,can we give image name that already exit one
推荐答案
您需要在数据库中使用特殊类型的字段-如图所示此处 [
You need to use a special type of field in the database - as shown here[^].
具有定义为
的表
Have a table defined as
// Table pictures
id int autoinc primary index
name varchar(200)
image blob
其中名称"是图像的元数据名称,存储在图像"列中
插入图片
Where "name" is the meta data name for the image, that is stored in column "image"
Insert an image
INSERT INTO pictures (name,image) VALUES("My face", [BLOB Data])
删除图像
Delete an image
DELETE FROM pictures WHERE id=23
检查图像是否已经存在
Check if image i already there
SELECT id FROM pictures WHERE name='My face'
这篇关于cn我们如何使用查询将图像存储在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文