title: MySql- convert empty string to null
body: <p>I have wrote a query in my <strong>php</strong> method to update the specific filed that has an empty string <code>''</code> to be set to <code>NULL</code>..</p>
  <pre><code>UPDATE user SET context=NULL WHERE context=''
  </code></pre>
  <p>or</p>
  <pre><code>UPDATE user SET context=NULL WHERE context=&quot;&quot;
  </code></pre>
  <p>When this method is executed successfully, it still does not update the table fields with empty string to null. What can be the issue?</p>
  <p>Tried:</p>
  <pre><code>UPDATE user SET context = NULL WHERE length(trim(context)) = 0
  </code></pre>