Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/247.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php If/else If/else带有对数据库的查询,结果为false。_Php_Mysql_If Statement - Fatal编程技术网

Php If/else If/else带有对数据库的查询,结果为false。

Php If/else If/else带有对数据库的查询,结果为false。,php,mysql,if-statement,Php,Mysql,If Statement,我有一个选择框,其中有一个“全部”选项,然后是一个用户列表 我正在努力创造这样的东西。除了试图查询数据库以检查变量是否在数据库中之外,我拥有大部分功能 if ($variable == 'All') { code here } else if ($variable != 'ALL' != *[result in database]*) { code here } else { code here } 除了试图查询数据库以检查变量是否在数据库中之外,我拥有大部分功能

我有一个选择框,其中有一个“全部”选项,然后是一个用户列表

我正在努力创造这样的东西。除了试图查询数据库以检查变量是否在数据库中之外,我拥有大部分功能

   if ($variable == 'All') { code here }

   else if ($variable != 'ALL' != *[result in database]*) { code here }

   else { code here }
除了试图查询数据库以检查变量是否在数据库中之外,我拥有大部分功能

   if ($variable == 'All') { code here }

   else if ($variable != 'ALL' != *[result in database]*) { code here }

   else { code here }
任何关于如何在if语句中合并mySQL数据库查询的建议


谢谢

你不能那样使用运算符

替换:

else if ($variable != 'ALL' != *[result in database]*) { code here }
与:


你不能用那样的运算符

替换:

else if ($variable != 'ALL' != *[result in database]*) { code here }
与:


如果您的
$variable!='如果您的
$variable!='所有“