随笔分类 -  php与数据库

解决cURL error 60: SSL certificate problem: unable to get local issuer certifica
摘要:https://curl.se/docs/caextract.html 阅读全文
posted @ 2023-09-08 14:58 chenlw101 阅读(23) 评论(0) 推荐(0)
php重启
摘要: 阅读全文
posted @ 2022-02-25 10:26 chenlw101 阅读(10) 评论(0) 推荐(0)
服务器php环境搭建与apache
摘要:Apache安装 yum install httpd 启动 systemctl start httpd.service #启动 systemctl stop httpd.service #停止 systemctl restart httpd.service #重启 第二、设置开机启动/关闭 syst 阅读全文
posted @ 2020-03-12 09:07 chenlw101 阅读(427) 评论(0) 推荐(0)
php分割字符串转为数组,数组添加元素
摘要:$a = "1-300";$b = explode("-",$a);print_r($b); $a=array("red","green"); array_push($a,"blue","yellow"); print_r($a); 阅读全文
posted @ 2020-03-11 18:38 chenlw101 阅读(531) 评论(0) 推荐(0)
WampServer中MySQL中文乱码解决
摘要:1、修改mysql的my.ini文件: 在 [client] 下面增加 default-character-set=utf8 在 [mysqld] 下面增加: character_set_server=utf8 2、创建数据库: 示例创建数据库代码: 创建数据库php: 创建表user: 插入数据: 阅读全文
posted @ 2019-05-23 14:40 chenlw101 阅读(574) 评论(0) 推荐(0)
数据库操作
摘要:select * from num where length(newnum) = 15 //指定字符串长度 select * from num where newnum not REGEXP '[0-9]{18}|[0-9]{17}X|[0-9]{15}'//使用正则 update num set newnum = upper(newnum) where newnum like ... 阅读全文
posted @ 2019-04-24 08:57 chenlw101 阅读(101) 评论(0) 推荐(0)
sql语句case when 以及left()
摘要:select count(CASE jyje WHEN '1300' THEN '2' ELSE '1' END) as count from tpent_orders where cplx = 6 and left(time,4) ='2019' 阅读全文
posted @ 2019-02-19 16:32 chenlw101 阅读(1097) 评论(0) 推荐(0)
php.ini文件修改完重启
摘要:killall php-pfm启动php-pfm 一般 service php-fpm restart 阅读全文
posted @ 2019-01-15 15:49 chenlw101 阅读(4401) 评论(0) 推荐(0)
php 对象转字符串
摘要:$json_string = json_encode($object, JSON_FORCE_OBJECT); json_encode($object); //结果:"[{"aa":"bb","cc":"dd"}]" json_encode($object,JSON_FORCE_OBJECT); //结果:"{"aa":"bb","cc":"dd"}" 阅读全文
posted @ 2019-01-12 13:50 chenlw101 阅读(12852) 评论(0) 推荐(0)
多表查询
摘要:一使用SELECT子句进行多表查询 SELECT 字段名 FROM 表1,表2 … WHERE 表1.字段 = 表2.字段 AND 其它查询条件 SELECT a.id,a.name,a.address,a.date,b.math,b.english,b.chinese FROM tb_demo065_tel AS b,tb_demo065 AS a WHERE a.id=b.id 注:在上面... 阅读全文
posted @ 2019-01-11 17:00 chenlw101 阅读(138) 评论(0) 推荐(0)
数据库基本操作
摘要:对于含有中文的数据插入,需要添加 插入数据: 查询数据: 更新数据: 删除数据: 阅读全文
posted @ 2018-09-03 11:17 chenlw101 阅读(107) 评论(0) 推荐(0)
多表查询
摘要:内连接 外连接 阅读全文
posted @ 2018-06-27 14:18 chenlw101 阅读(91) 评论(0) 推荐(0)
数据库单表查询详解
摘要://数据库分页 LIMIT 0,5;//表示从第一条开始的5条数据,默认0为第一条 LIMIT 5,5;//若是5个为一页,那么前5个到4,后5个从5开始 阅读全文
posted @ 2018-06-27 11:29 chenlw101 阅读(151) 评论(0) 推荐(0)
php添加多组数据到数据库
摘要://添加sql的数据 $sqldatas=getParam('sqldatas');//这里的sqldatas是从前台传过来的json字符串 //将json字符串转为json对象 $sqldata=json_decode($sqldatas,true); //插入多个值的时候 $sql= "INSE 阅读全文
posted @ 2018-06-19 10:38 chenlw101 阅读(929) 评论(0) 推荐(0)