dsvd407787736 2016-11-14 18:58
浏览 27

PHP - 将图像插入mysql表工作流[重复]

This question already has an answer here:

Let's go strait to the point:

I'm building a web-application with PHP5 and MySql and I have to insert some images (which are uploaded by the user) into the database;

database table: images_table ( id int(20), image blob );

form:<form action="background.php" method="post" enctype="multipart/form-data"> <input type="file" name="image"> <input type="submit"> </form>

the point is: after the form is submitted how does it work in the background.php file? I mean, how am I supposed to build an insert command and run it? How do I handle the image selected by the user?

I've seen/read many diferent codes but I lack some knowledge about the flow since the moment the user submits the form until the insert command is done.

OBS: I'm not using object oriented PHP. Should I use for this porpose? (If so, is it a problem use both OO and procedural php in the same page?)

If you need more information to be able to help me or I wasn't clear enough, please let me know. Thanks in advance!

</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用