Visualizzazione dei risultati da 1 a 4 su 4

Discussione: split

  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    589

    split

    ciao devo adattare questo codice, che cerca una parola se è contenuta in un campo testo che ne puo contenere anche altre, in maniera tale da poter cercare piu parole inserite per la ricerca , es: voglio cercare "cane lupo"..... questo è il codice

    codice:
    dim cerca, pp
    	'estrazione della pagina corrente
    	
    	pag=trim(request("pag"))
    		 cerca=replace(Trim(request("cerca")),"'", "")
             pp=cerca
    	 
    		
    	if pag="" then pag=1
    	  if IsEmpty(Request.querystring("cerca")) then
    		cerca = " where nomearticolo like '%" & Request.querystring("cerca") & "%'order by data desc " 
    
    		strricerca = "select * from richieste"
    	
    	else
    
    	
    
       if Request.querystring("cerca")<>""  then
          cerca = " where nomearticolo like '%" & cerca & "%'order by data desc" 
    
     
    			else
    				cerca = " where nomearticolo like '%' order by data desc"
    			end if
    				
    	
    		strricerca = "select * from richieste " & cerca 
    	
    	end if
    	
    	'Response.Write strricerca
    	'Response.End
    	set rsestrai=Server.CreateObject("adodb.recordset")
    		rsestrai.LockType=3
    		rsestrai.CursorType=3
    		rsestrai.PageSize=5
    		rsestrai.ActiveConnection=connessione
    		rsestrai.Open strricerca
    		
    
    
    %>

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    589
    ho risolto grazie ugualmente

  3. #3
    Visto che hai risolto potevi postarlo cosí lo usavano anche altri no?????

    Non é una critica ma molti di noi sono solo capaci di prendere senza DARE.

    Ciao.

    adriana www.brasile-natal.com

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    589
    guarda per me non ci sono problemi , basta chiederlo tanto è tutto gratis anche fare spam.


    codice:
    <%
    '	dim rsestrai, zona, tipologia, immobile, mq, importo
    '	dim strricerca, pag, i, rowcount, cerca, pp
    	dim cerca, pp, sql
    	'estrazione della pagina corrente
    	
    	pag=trim(request("pag"))
    		 cerca=replace(Trim(request("cerca")),"'", "")
             pp=cerca
    	 
    		
    	if pag="" then pag=1
    	  if IsEmpty(Request.querystring("cerca")) then
    		cerca = " where nomearticolo like '" & Request.querystring("cerca") & "%'order by data desc " 
    
    		sql = "select * from richieste"
    	
    	
    	
    	
    	
    	
    	
    	
    	else
    
    	
    
       if Request.querystring("cerca")<>""  then
         ' cerca = " where nomearticolo like '" & cerca & "%'order by data desc" 
    
    voci = split(cerca, " ")
    sql = "SELECT * FROM richieste WHERE"
    for i = 0 to ubound(voci)
    sql = sql & " nomearticolo LIKE '%" & voci(i) & "%'"
    if i < ubound(voci) then sql = sql & " and"
    next
    
    
     
    			else
    				cerca = " where nomearticolo like '%' order by data desc"
    				
    				sql = "select * from richieste " & cerca 
    			end if
    	
    			
    	
    			
    	
    		
    	
    	end if
    	
    	'Response.Write strricerca
    	'Response.End
    	set rsestrai=Server.CreateObject("adodb.recordset")
    		rsestrai.LockType=3
    		rsestrai.CursorType=3
    		rsestrai.PageSize=5
    		rsestrai.ActiveConnection=connessione
    		rsestrai.Open sql
    		
    
    
    %>
    
    
    
     :ciauz:

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.