Unknown column '504id' in 'where clause'