What happens if you do that as two separate queries from php? The fact it says error is on line 13 tells me you are doing it in one query and maybe php library is the problem.
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.