Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di fraude
    Registrato dal
    Feb 2004
    Messaggi
    2,870

    Problema con recordcount e limit

    Ciao a tutti.

    Ho questo codice che utilizzo per paginare dati asp+mysql; funziona quasi tutto soltanto quando applico queste condizioni le query invece di restituirmi il numero dei records selezionati o tutti i records mi restituiscono sempre e solo i primi 5 records, perchè?:

    codice:
    strRecs = request.querystring("recs")
    strFilter = request.querystring("filter")
    
    
    if strRecs <> "" then
      intRecordsPerPage = strRecs
    elseif strFilter <> "" then
      intRecordsPerPage = 10000
    else
      intRecordsPerPage = 5
    end if
    
    'QUERY SELECT
    
    if strRecs <> "" then
      intRecordsPerPage = strRecs
      strSql = "SELECT * from Gest LIMIT 1, "& intRecordsPerPage
    end if
    
    if strFilter <> "" then
      strSql = "SELECT * from Gest asc LIMIT 1, "& intRecordsPerPage
    end if
    
    .....
    
    
    'QUERY COUNT
    
    if strRecs <> "" then
      intRecordsPerPage = strRecs
      sql = "SELECT COUNT(*) from Gest LIMIT 1, "& intRecordsPerPage
    end if
    
    if strFilter <> "" then
      sql = "SELECT COUNT(*) from Gest LIMIT 1, "& intRecordsPerPage
    end if

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    E cosa dovrebbe restituirti?

    Roby

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.