今天突然发现维护的一个wordpress博客出现这种错误:
Warning: Missing argument 2 for wpdb::prepare()
[img]http://dl2.iteye.com/upload/attachment/0104/4244/8cb0bff1-853c-38cd-8160-27f1437afe34.png[/img]
===================================================
找到出错文件
[img]http://dl2.iteye.com/upload/attachment/0104/4246/84d42395-1cc4-3785-8c43-f4b1c7b0f0c1.png[/img]
改为如下
[img]http://dl2.iteye.com/upload/attachment/0104/4248/d23a2fa1-3daa-355c-9de3-401411e27105.png[/img]
====================================================
问题解决!!!
分析:
在SQL语句中,where条件变为了动态参数绑定形式:
post_date_gmt > %d”,“1970”
这种写法更安全!!!
参考:
[1] http://www.zihou.me/html/2012/12/12/8079.html
Warning: Missing argument 2 for wpdb::prepare()
[img]http://dl2.iteye.com/upload/attachment/0104/4244/8cb0bff1-853c-38cd-8160-27f1437afe34.png[/img]
===================================================
找到出错文件
[img]http://dl2.iteye.com/upload/attachment/0104/4246/84d42395-1cc4-3785-8c43-f4b1c7b0f0c1.png[/img]
改为如下
[img]http://dl2.iteye.com/upload/attachment/0104/4248/d23a2fa1-3daa-355c-9de3-401411e27105.png[/img]
====================================================
问题解决!!!
分析:
在SQL语句中,where条件变为了动态参数绑定形式:
post_date_gmt > %d”,“1970”
这种写法更安全!!!
参考:
[1] http://www.zihou.me/html/2012/12/12/8079.html