Home > Backend Development > PHP Tutorial > php环境下的sql语句,看不懂, 这是什么意思?解决方案

php环境下的sql语句,看不懂, 这是什么意思?解决方案

WBOY
Release: 2016-06-13 13:33:16
Original
937 people have browsed it

php环境下的sql语句,看不懂, 这是什么意思?
$query_Recordset1 = sprintf("SELECT * FROM tk_user WHERE tk_user_status LIKE %s AND tk_user_status NOT LIKE %s AND tk_display_name LIKE %s ORDER BY tk_user_registered DESC", ....
是做了什么操作?“tk_user_status LIKE %s AND tk_user_status NOT LIKE %s”不是矛盾了么?但是程序正常运行没问题啊!

------解决方案--------------------
这有什么不对吗? 三个字符串填充三个占位符。
------解决方案--------------------
这不矛盾啊!tk_user_status LIKE %s AND tk_user_status NOT LIKE %s
前面一个%s和后面的%s是不一样的变量,下面就是传入的参数变量
GetSQLValueString("%" . $colrole_Recordset1 . "%", "text"),
GetSQLValueString("%" . $colrole_dis . "%", "text"),

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template