title: Exists statement in SQL returns an array within an array with the key of the useful data as the query itself in PHP
body: <p>I have an SQL statement:</p>
  
  <pre><code>SELECT EXISTS(SELECT 1 FROM tbl WHERE id=123456)
  </code></pre>
  
  <p>Written in PHP using the <a href="https://github.com/ajillion/PHP-MySQLi-Database-Class" rel="nofollow">PHP-MySQLi-Database-Class</a>, this looks like so:</p>
  
  <pre><code>$results = $db-&gt;query('SELECT EXISTS(SELECT 1 FROM tbl WHERE property_id=123456)');
  print_r($results);
  </code></pre>
  
  <p>With <code>$results</code> looking like so:</p>
  
  <pre><code>Array ( [0] =&gt; Array ( [EXISTS(SELECT 1 FROM tbl WHERE id=123455)] =&gt; 1 ) ) 
  </code></pre>
  
  <p>The only useful part of that array is the 1 near the end indicating that the row was found.</p>
  
  <p>The way I would normally think to access this is with</p>
  
  <pre><code>$found = $results[0]['EXISTS(SELECT 1 FROM tbl WHERE id=123455)'];
  </code></pre>
  
  <p>which frankly seem ridiculous, and to boot doesn't work.</p>
  
  <p>How might I access this value, preferably in the most elegant way?</p>