You have another problem in the SQL, by the by.
WHEN (email=? AND code=?) THEN 'true'
WHEN (email=?) THEN 'false'
END AS answer
What happens if email
is *NOT* equal to the given value?
You have no WHEN
to handle that, so answer
will be NULL
Not sure your CASE really makes sense, as given.