ParseError thrown

syntax error, unexpected 'elseif' (T_ELSEIF), expecting while (T_WHILE)