title: WHERE - IS NULL not working in SQLite?
body: <p>Here's a strange one:</p>
  
  <p>I can filter on <code>NOT NULLS</code> from SQLite, but not <code>NULLS</code>:</p>
  
  <p><strong>This works:</strong></p>
  
  <pre><code>SELECT * FROM project WHERE parent_id NOT NULL;
  </code></pre>
  
  <p><strong>These don't:</strong></p>
  
  <pre><code>SELECT * FROM project WHERE parent_id IS NULL; 
  SELECT * FROM project WHERE parent_id ISNULL; 
  SELECT * FROM project WHERE parent_id NULL;
  </code></pre>
  
  <p>All return:</p>
  
  <blockquote>
    <p>There is a problem with the syntax of your query (Query was not
    executed) ...</p>
  </blockquote>
  
  <p><strong>UPDATE</strong>:</p>
  
  <p>I am doing this with PHP- through my code with ezSQl and using the <a href="http://www.danedesigns.com/phpliteadmin.php" rel="noreferrer">PHPLiteAdmin</a> interface </p>
  
  <p>Using the <a href="http://www.danedesigns.com/phpliteadmin.php?table=Customers&amp;action=table_sql" rel="noreferrer">PHPLiteAdmin demo</a>, this expression works- so now I'm suspecting a version issue with my PHP's SQLite?  Could that be?  Wasn't this expression always valid?</p>
  
  <p><strong>UPDATE 2</strong>:</p>
  
  <p>When I run the code from PHP using ezSQL, the PHP warning is:</p>
  
  <blockquote>
    <p>PHP Warning:  SQL logic error or missing database</p>
  </blockquote>
  
  <p>Is there a way to get more information out of PHP? This is maddeningly opaque and weird, especially because the same statement in the CLI works fine...</p>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>The only other possible clue I have is that the databases that I create with PHP cannot be read by the CLI, and vice versa.  I get:</p>
  
  <blockquote>
    <p>Error: file is encrypted or is not a database</p>
  </blockquote>
  
  <p>So there's definitly two SQlite flavors butting heads here. (<a href="https://stackoverflow.com/questions/1513849/error-file-is-encrypted-or-is-not-a-database">See this</a>)  Still, why the invalid statment??</p>
  
  <p><strong>UPDATE 4</strong></p>
  
  <p>OK I think I've traced the problem to the culprit, if not the reason- The DB I created with PHP ezSQL is the one where the IS NULL statement fails.  If I create the DB using PHP's SQLite3 class, the statement works fine, and moreover, I can access the DB from the CLI, whereas ezSQL created DB gave the <code>file is encrypted</code> error.</p>
  
  <p>So I did a little digging into ezSQL code- Off the bat I see it uses PDO methods, not the newer SQLite3 class.  Maybe that's something- I'm not gonna waste further time on it...</p>
  
  <p>In any case, I've found my solution, which is to steer clear of ezSQL, and just use PHPs SQLite3 class.</p>