上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 98 下一页
摘要: PHP中NULL和‘'区别 null的类型是null,""的类型是string 所以是不同东西 <pre>$a=22;unset($a);var_dump($a);</pre> 也是NULL类型 <pre>$a;var_dump($a);</pre> 也是NULL类型 ps:isset只有判断NUL 阅读全文
posted @ 2019-11-15 11:59 newmiracle宇宙 阅读(692) 评论(0) 推荐(0)
摘要: mysql 转换NULL数据方法<pre>SELECT info1,info2, IFNULL(info3,0) as info3 FROM `info1`;</pre><pre>IFNULL(expr1, expr2)</pre> 如果expr1不是NULL,IFNULL()返回expr1,否则返 阅读全文
posted @ 2019-11-15 11:58 newmiracle宇宙 阅读(721) 评论(0) 推荐(0)
摘要: nginx 出现413 Request Entity Too Large问题的解决方法 使用PHP上传图片(大小1.9M),出现 nginx: 413 Request Entity Too Large 错误。根据经验是服务器限制了上传文件的大小,但php默认的文件上传是2M,应该不会出现问题。 打开 阅读全文
posted @ 2019-11-15 11:58 newmiracle宇宙 阅读(201) 评论(0) 推荐(0)
摘要: mysql大小写敏感配置show global variables like '%lower_case%'; show global variables like '%lower_case%'; <pre>+ + +| Variable_name | Value |+ + +| lower_case 阅读全文
posted @ 2019-11-15 11:57 newmiracle宇宙 阅读(2001) 评论(0) 推荐(0)
摘要: mysql导入大批量数据出现MySQL server has gone away的解决方法<pre> mysql> show global variables like 'max_allowed_packet';+ + +| Variable_name | Value |+ + +| max_all 阅读全文
posted @ 2019-11-15 11:56 newmiracle宇宙 阅读(150) 评论(0) 推荐(0)
摘要: mysql函数concat与group_concat使用说明concat()函数<pre>mysql> select concat(',',name,',') from `user`;+ +| concat(',',fdipzone,',') |+ +| ,fdipzone, |+ +1 row i 阅读全文
posted @ 2019-11-15 11:41 newmiracle宇宙 阅读(146) 评论(0) 推荐(0)
摘要: mysql 查看当前使用的配置文件my.cnf的方法<pre>ps aux|grep mysql|grep 'my.cnf'</pre>如果上面的命令没有输出,表示没有设置使用指定目录的my.cnf。 如果没有设置使用指定目录的my.cnf,mysql启动时会读取安装目录根目录及默认目录下的my.c 阅读全文
posted @ 2019-11-15 11:40 newmiracle宇宙 阅读(819) 评论(0) 推荐(0)
摘要: PDO 查询mysql返回字段int变为String型解决方法使用PDO查询mysql数据库时,执行prepare,execute后,返回的字段数据全都变为字符型。 例如id在数据库中是Int的,查询后返回是String型。 对于PHP这种弱类型的语言,影响不大。在做API返回数据时,如果类型与数据 阅读全文
posted @ 2019-11-15 11:39 newmiracle宇宙 阅读(851) 评论(0) 推荐(0)
摘要: php合并数组并保留键值的方法例子1,数组使用字符串键名,相同的键名会被后面的覆盖<pre><?php$arr1 = array('name'=>'fdipzone');$arr2 = array('name'=>'terry'); $result = array_merge($arr1, $arr 阅读全文
posted @ 2019-11-15 11:39 newmiracle宇宙 阅读(610) 评论(0) 推荐(0)
摘要: mysql 连接闪断自动重连的方法(用在后台运行中的PHP代码)当mysql断开连接 $_instance这个还是有值得 所以会报错 MySQL server has gone away 这个地方需要捕捉异常才可以或许到 需要 清空连接 $_instance 这样就可以重新连接 就会报错了 <pre 阅读全文
posted @ 2019-11-15 11:37 newmiracle宇宙 阅读(513) 评论(0) 推荐(0)
上一页 1 ··· 64 65 66 67 68 69 70 71 72 ··· 98 下一页