摘要: $c = $a ?: $b; 等效于 $c = $a ? $a : $b; $c = $a ?? $b; 等效于 $c = isset($a) ? $a : $b; 示例: $a = null; $b = 'b'; $c = $a ?: $b; // b $c = $a ?? $b; // b $a 阅读全文
posted @ 2022-11-13 21:42 幽篁晓筑 阅读(124) 评论(0) 推荐(1) 编辑
摘要: 一、首先创建一张测试表,随便插入一点测试数据: CREATE TABLE `test_index` ( `id` int(11) NOT NULL AUTO_INCREMENT, `no` int(11) NOT NULL DEFAULT '0' COMMENT '订单号,int型', `no_st 阅读全文
posted @ 2022-10-15 15:39 幽篁晓筑 阅读(375) 评论(0) 推荐(0) 编辑
摘要: // 获取前一秒 strtotime("-1 seconds"); // 获取前一分钟 strtotime("-1 minute"); // 获取前一小时 strtotime("-1 hour"); // 获取前一天 strtotime("-1 day"); // 获取前一周 strtotime(" 阅读全文
posted @ 2022-10-02 07:50 幽篁晓筑 阅读(885) 评论(0) 推荐(0) 编辑
摘要: MySQL异常sql_mode=only_full_group_by 原因:在MySQL 5.7后MySQL默认开启了SQL_MODE严格模式,对数据进行严格校验。会报sql_mode=only_full_group_by错误说明写的SQL语句不严谨,对于group by聚合操作,select中的列 阅读全文
posted @ 2022-09-11 16:44 幽篁晓筑 阅读(964) 评论(0) 推荐(0) 编辑
摘要: 这里介绍两种安装方式:编译安装和使用编译后的安装包安装。 安装目录:/usr/local 一、使用编译安装包安装 1、进入安装目录: cd /usr/local 2、下载安装包: wget https://nodejs.org/download/release/latest-v16.x/node-v 阅读全文
posted @ 2022-09-04 11:11 幽篁晓筑 阅读(2044) 评论(0) 推荐(0) 编辑
摘要: 正常情况下 windows 是使用不了 telnet 命令的: 打开控制面板-》程序和功能-》启用或关闭 Windows 功能 勾选 "Telnet客户端" 选项,点击确定。 接下来就可以正常使用 telnet 命令了。 阅读全文
posted @ 2022-09-04 10:57 幽篁晓筑 阅读(402) 评论(0) 推荐(0) 编辑
摘要: systemctl status firewalld.service # 查看防火墙状态 systemctl start firewalld.service # 开启防火墙 systemctl stop firewalld.service # 关闭防火墙 systemctl enable firew 阅读全文
posted @ 2022-08-21 15:12 幽篁晓筑 阅读(67) 评论(0) 推荐(0) 编辑
摘要: 问题:crontab -e无法保存:/var/spool/cron/#tmp.localhost.localdomain.XXXXLjnf86: Operation not permitted 原因: /var/spool/cron 目录被 chattr 命令锁定,这一般时为了防止文件被篡改。 可以 阅读全文
posted @ 2022-08-21 15:09 幽篁晓筑 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1、下载地址:http://download.redis.io/releases/ 下载版本:redis-6.2.7.tar.gz 2、使用命令下载: wget http://download.redis.io/releases/redis-6.2.7.tar.gz 3、将文件拷贝到安装目录 /us 阅读全文
posted @ 2022-07-02 22:34 幽篁晓筑 阅读(508) 评论(0) 推荐(0) 编辑
摘要: 一、SUBSTRING_INDEX SUBSTRING_INDEX(str, delim, count) 根据 delim 符号分隔 str 字符串,并从第 count 分隔符截取,返回截取后的字符串。 str:待截取的字符串 delim:分隔符 count:索引,从第几个分隔符开始截取,如果 co 阅读全文
posted @ 2022-06-12 16:29 幽篁晓筑 阅读(209) 评论(0) 推荐(0) 编辑