By the by, this has nothing to do with MySQL.
Any time you see a message that includes T_VARIABLE or other T_xxx elements it is strictly a PHP error.
If it were a MySQL error, it would say so.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.