php中的多个和/或逻辑如果语句不起作用

时间:2016-08-04 14:24:27

标签: php if-statement logic logical-operators

我已经四处走动了,我似乎无法得到我想要的逻辑。

以下是代码:

   function fetchFile() {
    global $directory;
    if (isset($_GET['id'])) {
        global $sampleIssue,$freeIssue;
        $id = mysql_real_escape_string($_GET['id']);
        $result = mysql_query("SELECT `volume`,`number`,`EditorMessage` FROM `articles` WHERE `id`='$id';");
        $article = mysql_fetch_assoc($result);
if 
        (($article['volume']!=$sampleIssue['vol'] || $article['number']!=$sampleIssue['no']) || ($article['EditorMessage']==='N')
         && ($article['volume']!=$freeIssue['vol'] || $article['number']!=$freeIssue['no'])){
    global $needsLogin;
            $needsLogin = TRUE;
        }

基本上我需要登录为真或满足以下三个条件中的任何一个:

$article['volume']!=$sampleIssue['vol'] || $article['number']!=$sampleIssue['no']
OR
$article['EditorMessage']==='N'
OR
$article['volume']!=$freeIssue['vol'] || $article['number']!=$freeIssue['no']

我也尝试过开关盒,我只是没有得到它。

0 个答案:

没有答案