( ! ) Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 3065
Expression #2 of ORDER BY clause is not in SELECT list, references column 'clicshopping_test_ui.p.products_date_added' which is not in SELECT list; this is incompatible with DISTINCT
in /home/www//boutique/includes/OM/DbStatement.php on line 97s
< /code>
Es scheint, dass MySQL 5.7 keine Anforderung wie: < /p>
erlaubtselect .... distinct with order by rand(), p.products_date_added DESC
< /code>
Wenn ich dies verwende, funktioniert es: < /p>
select distinct .... with order by rand(),
< /code>
Wie kann ich diese Situation auflösen? $Qproduct = $OSCOM_PDO->prepare('select distinct p.products_id,
p.products_price
from :table_products p left join :table_specials s on p.products_id = s.products_id
where products_status = :products_status
and products_view = :products_view
and p.products_archive = :products_archive
order by rand(),
p.products_date_added DESC
limit :products_limit');
$Qproduct->bindInt(':products_status', 1);
$Qproduct->bindInt(':products_view', 1);
$Qproduct->bindInt(':products_archive', 0);
$Qproduct->bindInt(':products_limit',
(int)MODULE_FRONT_PAGE_NEW_PRODUCTS_MAX_DISPLAY);
Ich habe das neue Ubuntu installiert und mein Code hat ein [url=viewtopic.php?t=15738]Problem[/url] mit MySQL.[code]( ! ) Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 3065 Expression #2 of ORDER BY clause is not in SELECT list, references column 'clicshopping_test_ui.p.products_date_added' which is not in SELECT list; this is incompatible with DISTINCT in /home/www//boutique/includes/OM/DbStatement.php on line 97s < /code>
Es scheint, dass MySQL 5.7 keine Anforderung wie: < /p>
erlaubtselect .... distinct with order by rand(), p.products_date_added DESC < /code>
Wenn ich dies verwende, funktioniert es: < /p>
select distinct .... with order by rand(), < /code>
Wie kann ich diese Situation auflösen? $Qproduct = $OSCOM_PDO->prepare('select distinct p.products_id, p.products_price from :table_products p left join :table_specials s on p.products_id = s.products_id where products_status = :products_status and products_view = :products_view and p.products_archive = :products_archive order by rand(), p.products_date_added DESC limit :products_limit'); $Qproduct->bindInt(':products_status', 1); $Qproduct->bindInt(':products_view', 1); $Qproduct->bindInt(':products_archive', 0); $Qproduct->bindInt(':products_limit', (int)MODULE_FRONT_PAGE_NEW_PRODUCTS_MAX_DISPLAY); [/code]
Ich habe zwei Tabellen, die wie folgt definiert sind:
Eine Kleinanzeige wird von einem Benutzer erstellt und in dieser Tabelle gespeichert:
CREATE TABLE `classifieds` (
`ClassifiedAdID` mediumint...
Ich habe eine Basis -Rasier -Komponente, die Daten aus einer SQL -Datenbank lädt. Um eine Sortierreihenfolge an diese Komponente zu übergeben, gibt es zwei sortierende Func Parameter und zwei Bool,...
Ich entwickle eine Fastapi -App, und mein Ziel ist es, einige Informationen in einem Anforderungsbereich aufzunehmen und diese Informationen später in Protokolldatensätzen wiederzuverwenden. ist mein...
Ich habe Probleme, wenn ich versuche, eine Funktion von SELECT DETRO -Beispiel Date_Format (Date_end, % W% m% y ) als Dateend zu fügen.
$this->db->select(name, DATE_FORMAT(date_end, ‘% W% M% Y’) AS...
Ich habe 2 Tabellen. Erster Benutzer Zweiter Beitrag. Ohne die Klausel habe ich alle Benutzerbeiträge bekommen, aber ich möchte nur in Benutzerdaten angemeldet. Hier ist die Tabellenstruktur für...