AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

MySQL: Bedingtes ORDER BY?

Ein Thema von DGL-luke · begonnen am 18. Aug 2006 · letzter Beitrag vom 19. Aug 2006
 
Benutzerbild von DGL-luke
DGL-luke

Registriert seit: 1. Apr 2005
Ort: Bad Tölz
4.149 Beiträge
 
Delphi 2006 Professional
 
#1

MySQL: Bedingtes ORDER BY?

  Alt 18. Aug 2006, 14:32
Datenbank: MySQL • Version: 5 • Zugriff über: PHP mysql_*()
Hallo,

ich verstümmle ja hier seit längerer Zeit ein phpbb-forum zur Datenbank.

Folgendes Statement:

SQL-Code:
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
   FROM
" . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
   WHERE t.forum_id = $forum_id
      AND t.topic_poster = u.user_id
      AND p.post_id = t.topic_first_post_id
      AND p2.post_id = t.topic_last_post_id
      AND u2.user_id = p2.poster_id
      AND t.topic_type <>
" . POST_ANNOUNCE . "
      AND t.topic_title LIKE '$start_letter%'
      $limit_topics_time
   ORDER BY t.topic_type DESC, t.topic_title ASC
   LIMIT $start,
".$board_config['topics_per_page'];
Beim ORDER BY (ORDER BY t.topic_type DESC, t.topic_title ASC) würd ich jetzt gerne falls (t.forum_id = 1 OR t.forum_id = 2) das erste Ordnungskriterium komplett rausschmeissen. Geht das?
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:55 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz