小编pro*_*yb3的帖子

AND,或输出错误的结果

假设我使用2 AND和1 OR来检索结果,首先使用输入文本值进行测试name,我可以得到正确的结果但是当我更改$getc为除空字符串以外的任何值时,结果不会更改,它只查询name值.怎么了?

$query1 = "SELECT * FROM $tableName WHERE name LIKE '%$asd%' OR descriptions LIKE
    '%$asd%' AND category='$getc' AND company_type='$dsp' LIMIT $start, $limit";
Run Code Online (Sandbox Code Playgroud)

php mysql operators operator-precedence

1
推荐指数
1
解决办法
75
查看次数

标签 统计

mysql ×1

operator-precedence ×1

operators ×1

php ×1