SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "AND" LINE 1: ...ant_id = m.contestant_id WHERE m.contestant_id = AND m.cont... ^