sql error Unknown column 'application_typeindex' in 'where clause'