I think you got this message from PHP. You get this message when you're trying to access $result variable, but there's nothing in this variable because of WRONG SQL command before.