I have this sql statement to delete some rows:
DELETE
FROM
`user_group_membership` g
INNER JOIN `users` u ON u.user_id = g.user_id
WHERE
u.`user_id` NOT IN (?, ?, ?)
AND g.group_id IN (9, 6)
AND u.`lifetime_supporter` = 0
AND u.supporter_type = 'special'
I get an SQL error of "SQL ERROR SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'g INNER JOIN users
u ON u.user_id = g.user_id WHERE u.user_id
NOT IN ( ?,?,?"
Not entirely sure what's wrong here, could someone give me a pointer?