Unrecognized character within query

you have a missing parenthesis right after eq(k, $id) which causes the next { character to be misinterpreted.