title: MySQL select b'1' returns integer 1 or ASCII character 1 depending on environment
body: <p>On my home computer,</p>
  
  <p><code>mysql_fetch_row( mysql_query(" select b'1' ") )[0]</code></p>
  
  <p>returns string "1".</p>
  
  <p>But when hosted on webserver it returns string having ASCII character 1.</p>
  
  <p>Doc does say-</p>
  
  <blockquote>
    <p>Bit values are returned as binary values. To display them in printable
    form, add 0 or use a conversion function such as BIN().</p>
  </blockquote>
  
  <p>But on my local machine it still returns "1" without any conversion done by me.</p>
  
  <p>How can I have the same behavior on my web server?</p>
  
  <p>If I get the same behavior then I don't have to convert my PHP codes from like</p>
  
  <pre><code>$row = mysql_fetch_row( mysql_query(" select bit1_field from .. where .. ") );
  if( $row[0] === '1' ) ...;
  </code></pre>
  
  <p>to</p>
  
  <pre><code>... select bit1_field+0 as bit1_field ...
  </code></pre>
  
  <p>where <code>bit1_field</code> is of type <code>bit(1)</code>.</p>