最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP将图片存入mysql实现代码
时间:2022-06-24 19:05:20 编辑:袖梨 来源:一聚教程网
下面只告诉你如何实现图片如何保存到数据库教程,不推荐此种方法。
*/
mysql_connect('localhost','root','root');
mysql_select_db('ac');
$picdir ="/a/ag.gif";
$image = addslashes(file_get_contents($picdir));
$sql ="insert into tbl_name (field) values ('" . $image . "')";
mysql_query($sql);
/*
--
-- 表的结构 `test`
--
create table if not exists `test` (
`id` int(8) not null auto_increment,
`title` char(150) default null,
`content` longblob,
`addnewcolumn` varchar(20) not null,
primary key (`id`)
) engine=myisam default charset=utf8 auto_increment=1 ;
相关文章
- 电影电视剧太平年1080p蓝光百度云网盘资源下载 01-28
- 163网易免费邮箱登录入口-163免费邮箱注册与登录通道 01-28
- 抖音创作者-服务中心平台登录入口 01-28
- 学信网官网入口在哪-学信网学籍查询通道 01-28
- 虎牙网页版登陆入口-虎牙直播网页版一键登录 01-28
- 原神云游戏极速畅玩-原神网页版一键秒登直玩 01-28