in reply to bind_param - confusion ?

Why not re-write the sql so that the common conditions are stated only once -- then the question doesn't have to come up...
"select count(*) from MSG where Jan1= :KEIZIBAN and sex= :op_sex and EntPC= :EntPC and Pref= :BFLAG and (flag=1 or (flag=2 and ID > 0))"

(p.s.: This is the first time I've seen initial colon instead of initial+final single quotes around condition values in a where clause -- but if that works for you, great.)