3065 - Expression #1 of ORDER BY clause is not in SELECT list,
Publicado por Jame (2 intervenciones) el 01/05/2020 20:47:59
Hola,
Como consecuencia de una subida de version de PHP y MYSQL en el servidor donde tengo alojado mi pagina web, esta ha dejado de funcionar y se visualiza el siguiente mensaje de error:
3065 - Expression #1 of ORDER BY clause is not in SELECT list, references column 'bienesta_new.p.products_ordered' which is not in SELECT list; this is incompatible with DISTINCT
select distinct p.products_id, pd.products_name from products p, products_description pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '2' order by p.products_ordered desc, pd.products_name limit 10
Esto ocurre con las dos siguientes instrucciones del codigo PHP:
Versiones en el servidor:
MySQL: 5.7
PHP: Superior a 7.0
No tengo mucho conocimiento de PHP, alguien me podría ayudar para solventar este problema?
Gracias de antemano.
Como consecuencia de una subida de version de PHP y MYSQL en el servidor donde tengo alojado mi pagina web, esta ha dejado de funcionar y se visualiza el siguiente mensaje de error:
3065 - Expression #1 of ORDER BY clause is not in SELECT list, references column 'bienesta_new.p.products_ordered' which is not in SELECT list; this is incompatible with DISTINCT
select distinct p.products_id, pd.products_name from products p, products_description pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '2' order by p.products_ordered desc, pd.products_name limit 10
Esto ocurre con las dos siguientes instrucciones del codigo PHP:
1
2
3
4
5
6
7
8
9
10
<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($HTTP_GET_VARS['manufacturers_id']) && !empty($HTTP_GET_VARS['manufacturers_id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
} else {
$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
}
$filterlist_query = tep_db_query($filterlist_sql);
if (tep_db_num_rows($filterlist_query) > 1)
Versiones en el servidor:
MySQL: 5.7
PHP: Superior a 7.0
No tengo mucho conocimiento de PHP, alguien me podría ayudar para solventar este problema?
Gracias de antemano.
Valora esta pregunta


0