$query->select('if(bud.posa=2,1,0) AS proprietaire,if(bud.du=1 and bud.gog=1,1,0) as pa')->from('bud');
if I execute it is giving synthax error; I try to echo the sql that is being generated I found that it is not being generated(quoting problem) well, here is what is generated:
select if(bud.posa=2, `1`, `0)` AS `proprietaire`, if(bud.du=1 and bud.gog=1, `1`, `0)` AS `pa` FROM `bud`
`0)`
is what is causing the error ,I don’t see how to solve it,Any solution?