本文介绍了将图像插入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个表单,允许用户将图像上传到服务器中的文件夹。如何将图像插入数据库?我在名为blog的数据库中创建了名为upload的表名称,并且名为image的行名为mediumBLOB。
I have created a form that allows users to upload an image to a folder in the server. How do I insert the image into the database? I have created a table name called upload in the database named blog and a row called image with the value MediumBLOB.
如果上面的声音不合逻辑,我如何动态地从服务器调用图像?
If the above sounds illogical, how do i call the image from the server dynamically?
谢谢。
推荐答案
查看。但是,您应该考虑使用参数化查询,而不是直接传递查询参数。
See this howto. However, you should really consider using parametrized queries instead of passing the query arguments inline.
这篇关于将图像插入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!