You don't need a { in a one line IF statement.
What about if you change it to:
if ($query && method_exists($query,'close')) $query->close();
Does that eliminate the error? I think that is probably the right syntax.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.