I think those 4 lines can be replaced with '...city_lang IN ( ' . $db->makeList( $langs ) . ')';