title: Ignore function on if condition PHP
body: <p>I have some code but I want it to ignore 'customer::$data['vehicle_id']' when category_id = 1, 4, 9.</p>
  
  <p>I've struggled with the code below and to add another function is out of my capabilities, so any advice would be great. Thanks in advance.</p>
  
  <p>If vehicle_id is not selected it works fine. </p>
  
  <pre><code>if (empty($_GET['manufacturer_id'])) {
    $manufacturers_query = database::query(
      "select distinct m.id, m.name from ". DB_TABLE_PRODUCTS ." p
      left join ". DB_TABLE_MANUFACTURERS ." m on m.id = p.manufacturer_id ".
      (!empty($_GET['category_id']) ? " left join " . DB_TABLE_PRODUCTS_TO_CATEGORIES . " pc on pc.product_id = p.id " : "").
      (!empty(customer::$data['vehicle_id']) ? " left join " . DB_TABLE_PRODUCTS_TO_VEHICLES . " ptv on ptv.product_id = p.id " : "").
      "where p.status
      and manufacturer_id
      ". (!empty($_GET['category_id']) ? "and pc.category_id = " . (int)$_GET['category_id']  : "") ."
      ". (!empty(customer::$data['vehicle_id']) ? "and ptv.vehicle_id = " . (int)customer::$data['vehicle_id']  : "") ."
      order by m.name asc;"
    );
  </code></pre>
  
  <p>I've tried using this:</p>
  
  <pre><code>". (!empty(customer::$data['vehicle_id']) &amp;&amp; (!empty($_GET['category_id']) || !array_intersect(array(1, 4, 9), $_GET['category_id'])) ? "and ptv.vehicle_id = " . (int)customer::$data['vehicle_id']  : "") ."
  </code></pre>
  
  <p>EDIT:</p>
  
  <pre><code>while($manufacturer = database::fetch($manufacturers_query)) {
        $box_filter-&gt;snippets['manufacturers'][] = array(
          'id' =&gt; $manufacturer['id'],
          'name' =&gt; $manufacturer['name'],
          'href' =&gt; document::ilink('manufacturer', array('manufacturer_id' =&gt; $manufacturer['id'])),
        );
      }
  </code></pre>