Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Motore di ricerca!

  1. #1

    Motore di ricerca!

    AriSalve!
    Vorrei un Vs consiglio.

    Sto realizzando un motore di ricerca con più opzioni di scelta che si combinano (10 diverse possibilità):

    1 - Dato che per fare ciò devo fare molti if....then..end if, mi chiedevo se ci fosse un metodo alternativo al classico if:

    2 - Un codice scritto così è molto pesante?

    Es:
    if (IDscheda) = "" and q <> "" and (foto) = "" then
    sqlCount="select COUNT(IDuser) from scheda WHERE ruolo='"&q&"' AND complete = 'Y'"

    ElseIf and q = "" and (foto) = "" and (stato) = "" and (classe) = "" then
    sqlCount="select COUNT(IDuser) from scheda WHERE IDuser='"&IDscheda&"' AND complete = 'Y'"

    ElseIf (IDscheda) <> "" and q <> "" then
    sqlCount="select COUNT(IDuser) from scheda WHERE IDuser='"&IDscheda&"' AND complete = 'Y'"
    ......
    ......
    .....
    end if

    AriGrazie!

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Non vedo molte alternative.
    Questa parte

    sqlCount="select COUNT(IDuser) from scheda

    visto che è comune la terrei fuori ed aggiungerei ad essa il risultato dell'IF THEN...

    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 © 2026 vBulletin Solutions, Inc. All rights reserved.