title: PHP: syntax for using boolean variables in MYSQL database for logic
body: <p>php/mysql noob with question.  MYSQL does not seem to have a preferred way to store boolean values.  I decided to go with Tiny(int) at the suggestion of someone on a message board who said this is equivalent to True/False.  I would think that True =1 and False =0...maybe that's assuming to much...  Anyway put 1 values in mysql dbase for testing.  They showed up in phpAdmin as "1" for what that's worth.</p>
  
  <p>I'd like to retrieve these values and if TRUE show picture and if false, not show it.  So after connecting with dbase and running successful query that returns other text values fine, I wrote...</p>
  
  <pre><code>if ($row['email'] == TRUE)
  {
  echo "&lt;img src='images/email.png'&gt;";
  }
  </code></pre>
  
  <p>Alternatively in place of TRUE, I've tried 1, '1' "1" 'TRUE' etc.</p>
  
  <p>If I just echo $row('email'), I get 1.  However, the above logic does not work.  The condition is never meant and the image never shows.  I tried turning it around with != but still can't get it to work.  From what I've read, booleans in MYSQL can be a bit flaky but this seems pretty basic.</p>
  
  <p>Note.  With above code, there is no error.  It just never evaluates the statement in parentheses as true to execute conditional.  Could it be a syntax error??? or what am I missing.  </p>
  
  <p>Thanks for any suggestions!</p>