Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL: Hilfe bei einer DB-Query

Empfohlene Antworten

Veröffentlicht

Ich möchte einige Statistiken mit einzelnen Topwerten/-tabellen erstellen.

Meine "Anfangsabfrage" schaut zur Zeit wie folgt aus:


$result = mysql_query("SELECT a,b,c,d
FROM ".$conf['db_prefix']."_db
WHERE a > '0' AND status = '1'
ORDER BY a DESC
LIMIT ". $anzahl);
[/php]

Die anderen Tabellen sollen halt nach b, c, oder d sortiert werden.

Nun möchte ich aber nicht jedesmal die komplette SELECT-Abfrage ausführen. Daher meine Frage, ob ich nach dem SELECT nacheinander nach unterschiedlichen Werten sortieren lassen kann?

Also nach dem [i]ORDER BY a DESC[/i] das Ergebnis z.B. als [i]topA[/i] zwischenspeicher und danach mit [i]GROUP BY b DESC[/i] forfahre.

hi,

kannst du nicht a durch eine php-variable ersetzen?

grüße von ipu

  • Autor

Öhm...und wie wäre mir da geholfen?

Ziel ist es ja, dass ich eine größere SELECT-Abfrage schreibe und dann im Anschluß diese Werte mittels einer weiteren DB-Query oder auch PHP unterschiedlich sortiere.

ah, ok. dann hab ich das falsch verstanden.

hoffe, jemand anders kann dir helfen.

grüße von ipu

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.