title: PHP: MYSQL Query returns wrong value
body: <p>I wrote a function in php which updates a mysql-table according to a given array.
  Before updating, I check whether there already exists an entry with the same ‚description‘-value.</p>
  
  <pre><code>// $fachtyp is given by foreach
  $query = "SELECT IF(EXISTS(SELECT 1 FROM fachtyp WHERE `Description`='$fachtyp'),'true','false')"
      . " AS existance";
  $result = mysqli_query($con, $query);
  $row = mysqli_fetch_assoc($result);
  $exists = ($row['existance'] === 'true');
  if (!$exists) { /* update */ }
  </code></pre>
  
  <p>The problemis as follows: When I debugged this, i recognised $row['exists'] to be twhile debugging) to return 'false' in netbeans. How can this happen??</p>
  
  <p>Thx fer reply, Lukas</p>