productsId = $productsId; $this->getDades($productsId); $this->model = (empty($this->dades['products_model']) ? FALSE : $this->dades['products_model']); } public function getDades() { $sql = 'SELECT * FROM products WHERE products_id = '.$this->productsId; $rs = Bd::registre($sql); $this->dades=$rs; return $rs; } }3065 - Expression #2 of ORDER BY clause is not in SELECT list, references column 'fundasch_db.popt.products_options_sort_order' which is not in SELECT list; this is incompatible with DISTINCT

select distinct popt.products_options_id, popt.products_options_name from products_options popt, products_attributes patrib where patrib.products_id='1433' and patrib.options_id = popt.products_options_id and popt.language_id = '3' order by popt.products_options_name, popt.products_options_sort_order ASC