If you were to use the proper object form of it, you'd spot the mistake, as it 
will tell you that you are trying to perform an action on a non-object. 

It might be a bug, or the developers might not have cared figuring that if you 
threw it in an if(!...) it would validate as false anyways. But it.might be a 
bug or an oversight. It might actually be falling through some ifs and 
returning the result that was instantiated as null, I dunno...

Sent from my Verizon Wireless 4GLTE smartphone

----- Reply message -----
From: "James Colannino" <ja...@colannino.org>
To: <php-general@lists.php.net>
Subject: [PHP] mysqli_query() returns NULL?
Date: Fri, Jun 17, 2011 4:40 pm


Hey everyone,

After reading the documentation for mysqli_query(), I was lead to 
believe that on any error it would return false.  However, through a 
stupid mistake, I discovered that when I specify an invalid value for 
the database link identifier (in my case, I accidentally passed an 
integer), instead of false I get a return value of NULL.  Does anyone 
know why?

Thanks!

James

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to