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.

PHP/mySQL | LIMIT lässt den akutellsten Beitrag aus?

Empfohlene Antworten

Veröffentlicht


$strMySqlQuery = "SELECT ID, TIME, TEXT, REF_ID FROM HS_NEWS_COMMENT WHERE NAME='".
$HTTP_POST_VARS['UserName']."' ORDER BY TIME DESC LIMIT 10";
[/php]

Mit dieser Abfrage hole ich mir die letzten zehn Posts aus der Tabelle, der letzte zuerst. Das haut auch hin. Das Problem dabei ist, das wenn ich elf Einträge habe, der erste Eintrag der mit Nummer zehn ist, sprich der aktuellste ignoriert wird. Warum? Die Spalte TIME speichert einen timestamp die sind also immer gleich und auch immer anders. Ich komme nicht drauf worans liegt. Danke für jede Hilfe.

Hi,

probier es mal mit Limit 0, 10.

Hab ich bei mir überall so, wenn ich die ersten 10 auslesen will und das klappt auch.

Ansonsten kann es auch an der Art liegen, wie du es ausgibst.

MfG

LIMIT 0, 10 habe ich schon probiert, das haut auch nicht hin. Ausgeben tue ich das ganze absolut standard:


while ($rgComments = mysql_fetch_array($MySqlResult))
{
...
echo $rgComments['Spalte'];
....
}
[/php]

Ich weiß nicht an was es liegt. Sehr seltsam :rolleyes:.

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.