Unknown column 'vendor' in 'where clause'