Visualizzazione dei risultati da 1 a 3 su 3

Discussione: select top

  1. #1

    select top

    Salve, ho questa query

    $query = "select top 3 * from popsongs where id<>'$songid' AND ...

    mi restituisce

    Errore nella query: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '3 * from TABLE where id<>'2563' AND voted>'0' AND datadd<'2...

    se tolgo top 3 e metto select * o dei campi funziona, non prende il TOP.

    come mai ?

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    6,034
    con mysql c'è LIMIT

    select * from popsongs where id<>'$songid' AND ... LIMIT 0,3

  3. #3
    gia cavolo, ho dimenticato che oltre al linguaggio ho cambiato anche il db..

    scusate.. e grazie mille per tutti i tuoi aiuti.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.