Use $db->conditional() instead of non-standard IF(). Fixes bug 13430.