title: How to show only certain items
body: <p>The code below gets all domains from a database table called &quot;url_domain&quot; in my database and outputs them in a dropdown list that users can use to select which domain to use from.</p>
  <p>What I want when this code is run is that instead of it showing all available domains in the list it should only show the domains where in the database <code>premium_only</code> is set to 1 and 6, nothing else should be shown in the list.</p>
  <p><strong>If I try the following</strong><br />
  If I try to use the following code the only domains with premium_only set to 1 shows up when I run it not both 1 and 6, why?</p>
  <pre><code>if(($shortUrlDomain['premium_only'] != '1') &amp;&amp; ($shortUrlDomain['premium_only'] != '6'))
  {
  continue;
  }
  </code></pre>
  <p><strong>Other stuff</strong>:</p>
  <p>Database layout:</p>
  <pre><code>Table: url_domain
  
  id | domain           | premium_only | status  | date_created
  ---+------------------+--------------+---------+-------------------
  1  | exaple.com       | 1            | enabled | 2020-03-02 08:13:00
  2  | exaple2.com      | 0            | enabled | 2021-03-02 08:13:00
  3  | exaple2.org      | 0            | enabled | 2021-03-02 08:13:00
  4  | text.exaple2.se  | 6            | enabled | 2021-03-02 08:13:00
  </code></pre>
  <p>PHP code:</p>
  <pre><code>&lt;div&gt;
      &lt;label for=&quot;shortUrlDomain&quot;&gt;&lt;?php echo t(&quot;short_url_domain&quot;, &quot;Short Url Domain&quot;); ?&gt;:&lt;/label&gt;
      &lt;select id=&quot;shortUrlDomain&quot; name=&quot;shortUrlDomain&quot; style=&quot;width: 100%;&quot;&gt;
          &lt;?php
          foreach ($shortUrlDomains AS $k =&gt; $shortUrlDomain)
          {
              echo '&lt;option value=&quot;' . (int) $k . '&quot;';
              // selected option
              if ($k == (int) $_REQUEST['shortUrlDomain']) {
                  echo ' SELECTED';
              }
              echo '&gt;';
              echo $shortUrlDomain['domain'];
              if($disabled == true) {
                  echo ' ('.safeOutputToScreen(t('unavailable', 'unavailable')).')';
              }
              '&lt;/option&gt;';
          }
          echo '&lt;/optgroup&gt;';
      ?&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  
  // get base urls
  $shortUrlDomains = getShortUrlDomains();
  
  static function getShortUrlDomain($domainId)
  {
      // get base urls
      $shortUrlDomains = getShortUrlDomains();
      
      if(!isset($shortUrlDomains[$domainId]))
      {
          return _CONFIG_SITE_PROTOCOL.'://'._CONFIG_SITE_FULL_URL;
      }
      
      return _CONFIG_SITE_PROTOCOL.'://'.$shortUrlDomains[$domainId]['domain'];
  }
  </code></pre>