dpje52239 2016-07-21 08:41
浏览 42
已采纳

在MySQL数据库中保存一个存储在Xampp localhost目录中的映像,没有表单

Sorry, I am new coding html and php and at this point I don´t know how to progress. What I want to do is the next:

I am using a xampp server where I have a folder with images already stored on the server like this:

/img/ima1.png
/img/ima2.png
/img/ima3.png

I want to use PHP to save this images on a MySQL database as a blob without using html form, just use the path of the image to get the content and save it on my database, without a tmp file and forms.

please is this possible?

Thanks in advance!

  • 写回答

3条回答 默认 最新

  • dongmei8071 2016-07-21 08:47
    关注

    mysql LOAD_FILE reference

    INSERT INTO `table_name` (`column_name`)
    VALUES(LOAD_FILE('/full/path/to/new/image.jpg'));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器