如何使用PHP上传数据库中的图像? [英] how to upload image in database using php?
本文介绍了如何使用PHP上传数据库中的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿,我想上传一张图片,我想在database.o中保存它的路径。我可以这样做吗?
hey i want to upload an image and i want to save its path in database.how can I do it?
推荐答案
首先插入一条新记录在你的表中将上传的图像重命名为last_insert_id()与php中的copy()或rename()函数。
first of all insert a new record in your table after that rename the uploaded image to last_insert_id() with copy() or rename() function in php .
检查出来: http://stackoverflow.com/questions/19529896/how-to-upload-image-and-save-路径到数据库 [ ^ ]
这篇关于如何使用PHP上传数据库中的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文