程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

Php adding images to Mysql Database

发布于2023-05-25 21:33     阅读(979)     评论(0)     点赞(14)     收藏(3)


I would adding images to mysql database as Blob using Php. I can adding image to mysql databases but i can't adding images.

The code :

$image = fopen($_FILES['image']['tmp_name'], 'rb');

 $connection = new PDO("mysql:host=localhost;dbname=php","php","");
 $adddata = $connection -> prepare("insert into images (image) value (?)");
 $adddata -> bindParam(1, $image, PDO::PARAM_LOB);

 $adddata -> execute();

I know there are differents ways but i would use this code.


解决方案


暂无回答



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:http://www.phpheidong.com/blog/article/546149/6d7ba4bd31bacc66baee/

来源:php黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

14 0
收藏该文
已收藏

评论内容:(最多支持255个字符)