Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.net搜索功能编辑_Asp.net_Sql_Sql Like - Fatal编程技术网

ASP.net搜索功能编辑

ASP.net搜索功能编辑,asp.net,sql,sql-like,Asp.net,Sql,Sql Like,我被要求在别人的代码中编辑搜索功能 我对这门特殊的语言没有太多的知识,虽然我确信这是一个简单的解决办法,但我不想在没有建议的情况下打破它 搜索功能返回的结果太多,其搜索部分为单词。所以搜索“e”会带回所有带有“e”的东西 我需要编辑以搜索整个单词 这是完整的代码 <!-- #include virtual="/site-elements/includes/config.asp" --> <!-- #include virtual="/site-elements/incl

我被要求在别人的代码中编辑搜索功能

我对这门特殊的语言没有太多的知识,虽然我确信这是一个简单的解决办法,但我不想在没有建议的情况下打破它

搜索功能返回的结果太多,其搜索部分为单词。所以搜索“e”会带回所有带有“e”的东西

我需要编辑以搜索整个单词

这是完整的代码

    <!-- #include virtual="/site-elements/includes/config.asp" -->
<!-- #include virtual="/site-elements/includes/folder-string-functions.asp" -->
<!-- #include virtual="/site-elements/includes/database-open.asp" -->
<!-- #include virtual="/site-elements/includes/field-filtering-functions.asp" -->
<!-- #include virtual="/site-elements/includes/login-checker.asp" -->
<!-- #include virtual="/site-elements/includes/date-functions.asp" -->
<!-- #include virtual="/site-elements/includes/form-counter.asp" -->
<!-- #include virtual="/site-elements/includes/email-check-code-functions.asp" -->
<!-- #include virtual="/site-elements/includes/trimstring-functions.asp" -->
<!-- #include virtual="/site-elements/includes/toilehighlighter-functions.asp" -->
<!-- #include virtual="/site-elements/includes/paging-functions.asp" -->
<!-- #include virtual="/site-elements/includes/regular-expression-functions.asp" -->
<%
lightboxgallery = "Yes"

searchfor = fieldfiltering(Request("searchfor"))
searchfor = TRIM(searchfor)
IF RIGHT(searchfor, 1) = "/" then searchfor = LEFT(searchfor, LEN(searchfor)-1)

seotitle = "Tube Tech International - search results for: " & searchfor
seodescription = "Tube Tech International search results for: " & searchfor
seokeywords = "Tube Tech International, " & searchfor

Session("searchedfor") = searchfor
Session("searchedfortime") = now()
%>

<!-- #include virtual="/site-elements/template/template-start.asp" -->

<%

'#### Paging ####
thispage = id1
If NOT ISNUMERIC(thispage) OR thispage = "" then 
thispage = 1
Else
thispage = CINT(thispage)
End If
'#################

%>

<div id="breadcrumbs">
<form action="/search/" method="get" class="searchform"><input type="submit" name="submit" tabindex="2" value="Search" class="search-click" /><input type="text" tabindex="1" value="Type your search here" onfocus="this.value=''" name="searchfor" class="search-box" /></form>
<a href="/"><img src="/images/home.png" alt="Home" width="12" height="12" class="home" border="0" /></a>
<a href="/" class="active">Home</a>
<a href="#">Search for: <i><% =searchfor %></i></a>
</div> 

<div id="searchcontent">

    <div class="leftbox">
    <h1>Search</h1>
    <p class="opening"><b>Your search results: <% =searchfor %></b></p>
    <div class="clear"></div>
    </div>

   <% If searchfor <> "" then %>    

   <div class="rightbox">
        <h2>Photo Gallery</h2>
        <p>Click the images for a larger view.</p>

        <div id="gallery">

            <%

            listingstringloop = ""
            listingstring = ""
            counterdiv = 0

            strSQL = ""

            strSQL        = "SELECT 'case-studies' AS pagetype, cs.title AS entrytitle, cs.casestudyid AS id, csi.casestudyimageid AS imageid, csi.imagetitle,  LIKE (cs.title, cs.content) AGAINST ('" & searchfor & "') AS relevance, LIKE (csi.imagetitle) AGAINST ('" & searchfor & "') AS imagerelevance "

            strSQL = strSQL & "FROM casestudies AS cs, casestudiesimages AS csi "

            strSQL = strSQL & "WHERE cs.casestudyid = csi.casestudyid AND cs.modestatus = '1' AND ((LIKE(csi.imagetitle) OR (cs.title like '%"& searchfor & "%') OR (cs.content like '%" & searchfor & "%') OR (csi.imagetitle like '%" & searchfor & "%')) "

            strSQL = strSQL & "UNION ALL "


            strSQL = strSQL & "SELECT 'news' AS pagetype, news.title AS entrytitle, news.newsid AS id, newsimages.newsimageid AS imageid, newsimages.imagetitle, LIKE (news.title, news.content) AGAINST ('" & searchfor & "') AS relevance, LIKE (newsimages.imagetitle) AGAINST ('" & searchfor & "') AS imagerelevance "

            strSQL = strSQL & "FROM news, newsimages "

            strSQL = strSQL & "WHERE news.newsid = newsimages.newsid AND news.modestatus = '1' AND ((news.title like '%" & searchfor & "%') OR (news.content like '%" & searchfor & "%') OR (newsimages.imagetitle like '%" & searchfor & "%')) "

            strSQL = strSQL & "GROUP BY id "

            strSQL = strSQL & "ORDER BY relevance DESC, imagerelevance DESC "


            Set rsSearch = my_conn.Execute(strSQL)

            If rsSearch.EOF = False then

            counter = 1

               Do while NOT rsSearch.eof 

                If counter > 2 then counter = 1       

                thisid = reversefieldfiltering(rsSearch("id"))
                thistitle = reversefieldfiltering(rsSearch("entrytitle"))
                imageid = reversefieldfiltering(rsSearch("imageid"))
                pagetype = reversefieldfiltering(rsSearch("pagetype"))
                imagetitle = reversefieldfiltering(rsSearch("imagetitle"))

                listingstring = "<a href=""/images/" & pagetype & "/images/" & imageid & "-3.jpg"" class=""normal"" title=""" & imagetitle

                If pagetype = "case-studies" then
                listingstring = listingstring & "<br />To read the case study in full please <a href='http://www.tubetech.com" & buildlink("/case-studies/" & thisid & "_" & thistitle & "/") & "'>click here</a>"
                ElseIf pagetype = "news" then
                listingstring = listingstring & "<br />To read the news story in full please <a href='http://www.tubetech.com" & buildlink("/news/" & thisid & "_" & thistitle & "/") & "'>click here</a>"
                End If

                listingstring = listingstring & """>"

                listingstring = listingstring & "<img src=""/images/" & pagetype & "/transparent.gif"" style=""background-image:url('/images/" & pagetype & "/images/" & imageid & "-1.jpg');background-position:center;"" width=""115"" height=""86"" alt=""" & imagetitle & """ title=""" & imagetitle & """ "
                If counter = 1 then 
                    listingstring = listingstring & "class=""left"""
                Else 
                    listingstring = listingstring & "class=""right"""
                End If 
                listingstring = listingstring & "/></a>" & vbcrlf

                listingstringloop = listingstringloop & listingstring

            counter = counter + 1
            counterdiv= counterdiv + 1    
            rsSearch.MoveNext
            loop        
            %>

                <div class="photocontainer"<% If counterdiv < 7 then %> style="height:auto;"<% End If %>>
                <div id="photocontent" style="overflow: hidden;">

                <% =listingstringloop %>

                </div>
                </div>

            <%          
            End if 

            rsSearch.Close
            Set rsSearch = Nothing

            %>              

        </div>
    </div>

    <div class="leftbox">

        <% If searchfor <> "" then %>


            <%

            searchrecordin = "No"

            listingstringloop = ""
            listingstring = ""
            counterleftbox = 0

            strSQL = ""
            strSQL  = "SELECT 'case-studies' AS pagetype, cs.casestudyid AS id, cs.title, cs.content, 0 AS menutype, '' AS menuoption, LIKE (cs.title, cs.content) AGAINST ('" & searchfor & "') AS relevance FROM casestudies AS cs "          
            strSQL = strSQL & "WHERE cs.modestatus = '1' AND (LIKE(cs.title, cs.content) AGAINST ('" & searchfor & "' IN BOOLEAN MODE) OR (cs.title like '%" & searchfor & "%') OR (cs.content like '%" & searchfor & "%')) "           
            strSQL = strSQL & "GROUP BY id "
            strSQL = strSQL & "ORDER BY lastupdated DESC "
'           strSQL = strSQL & "ORDER BY relevance DESC "            
            Set rsSearch = my_conn.Execute(strSQL)

            If rsSearch.EOF = False then
            searchrecordin = "Yes"
            %>
            <h2 class="section">Case studies</h2>
            <%          
                Do while NOT rsSearch.eof            

                id = reversefieldfiltering(rsSearch("id"))
                pagetype = reversefieldfiltering(rsSearch("pagetype"))
                title = reversefieldfiltering(rsSearch("title"))
                menutype = reversefieldfiltering(rsSearch("menutype"))
                menuoption = reversefieldfiltering(rsSearch("menuoption"))

                content = rsSearch("content")
                content = reversefieldfiltering(content)
                content = striptags(content)
                content = trimstring(content, 148)
                content = toilehighlighter(content, searchfor)
                content = content & "..."

                If pagetype = "web-pages" then
                    If menutype = "1" then              
                        linkname = buildlink("/" & title & "/")             
                    ElseIf menutype = "2" then
                        linkname = buildlink("/" & menuoption & "/" & id & "_" & title & "/")               
                    End If  
                Else

                    linkname = buildlink("/" & pagetype & "/" & id & "_" & title & "/") 

                End If

                title = toilehighlighter(title, searchfor)

                listingstring = "<h3><a href=""" & linkname & """>" & title & "</a></h3>" & vbcrlf
                listingstring = listingstring & "<p class=""opening""><a href=""" & linkname & """>" & content & "</a></p>" & vbcrlf

                listingstringloop = listingstringloop & listingstring


            counterleftbox = counterleftbox + 1
            rsSearch.MoveNext
            loop
            %>

            <div class="casestudiescontainer"<% If counterleftbox < 5 then %> style="height:auto;"<% End If %>>
            <div id="casestudiescontent">
            <% =listingstringloop %>        
            </div>
            </div>

            <% End if 

            rsSearch.Close
            Set rsSearch = Nothing  
            %>


            <%

            listingstringloop = ""
            listingstring = ""
            counterleftbox = 0

    strSQL = ""
                strSQL = "SELECT 'news' AS pagetype, news.newsid AS id, news.title, news.content, 0 AS menutype, '' AS menuoption, LIKE (news.title, news.content) AGAINST ('" & searchfor & "') AS relevance FROM news "
    strSQL = strSQL & "WHERE news.modestatus = '1' AND (LIKE(news.title, news.content) OR (news.title like '%" & searchfor & "%') OR (news.content like '%" & searchfor & "%')) "           
    strSQL = strSQL & "GROUP BY id "
    strSQL = strSQL & "ORDER BY relevance DESC "
                Set rsSearch = my_conn.Execute(strSQL)

            If rsSearch.EOF = False then
            searchrecordin = "Yes"
            %>          
            <h2 class="section">News</h2>            
            <%
                Do while NOT rsSearch.eof 

                id = reversefieldfiltering(rsSearch("id"))
                pagetype = reversefieldfiltering(rsSearch("pagetype"))
                title = reversefieldfiltering(rsSearch("title"))
                menutype = reversefieldfiltering(rsSearch("menutype"))
                menuoption = reversefieldfiltering(rsSearch("menuoption"))

                content = rsSearch("content")
                content = reversefieldfiltering(content)
                content = striptags(content)
                content = trimstring(content, 148)
                content = toilehighlighter(content, searchfor)
                content = content & "..."

                If pagetype = "web-pages" then
                    If menutype = "1" then              
                        linkname = buildlink("/" & title & "/")             
                    ElseIf menutype = "2" then
                        linkname = buildlink("/" & menuoption & "/" & id & "_" & title & "/")               
                    End If  
                Else

                    linkname = buildlink("/" & pagetype & "/" & id & "_" & title & "/") 

                End If              

                title = toilehighlighter(title, searchfor)

                listingstring = "<h3><a href=""" & linkname & """>" & title & "</a></h3>" & vbcrlf
                listingstring = listingstring & "<p class=""opening""><a href=""" & linkname & """>" & content & "</a></p>" & vbcrlf

                listingstringloop = listingstringloop & listingstring

            counterleftbox = counterleftbox + 1
            rsSearch.MoveNext
            loop

            %>

            <div class="newscontainer"<% If counterleftbox < 5 then %> style="height:auto;"<% End If %>>
            <div id="newscontent">  
            <% =listingstringloop %>        
            </div>
            </div>

            <% End if 

            rsSearch.Close
            Set rsSearch = Nothing  
            %>

            <%

            listingstringloop = ""
            listingstring = ""
            counterleftbox = 0

            strSQL = ""
            strSQL = "SELECT 'techniques' AS pagetype, tech.techniqueid AS id, tech.title, tech.content, 0 AS menutype, '' AS menuoption, LIKE (tech.title, tech.content) AGAINST ('" & searchfor & "') AS relevance FROM techniques AS tech "
            strSQL = strSQL & "WHERE tech.modestatus = '1' AND (LIKE(tech.title, tech.content) OR (tech.title like '%" & searchfor & "%') OR (tech.content like '%" & searchfor & "%')) "           
            strSQL = strSQL & "GROUP BY id "
            strSQL = strSQL & "ORDER BY relevance DESC "
            Set rsSearch = my_conn.Execute(strSQL)

            If rsSearch.EOF = False then            
            searchrecordin = "Yes"
            %>          
            <h2 class="section">Techniques</h2>               
            <%

                Do while NOT rsSearch.eof            

                id = reversefieldfiltering(rsSearch("id"))
                pagetype = reversefieldfiltering(rsSearch("pagetype"))
                title = reversefieldfiltering(rsSearch("title"))
                menutype = reversefieldfiltering(rsSearch("menutype"))
                menuoption = reversefieldfiltering(rsSearch("menuoption"))

                content = rsSearch("content")
                content = reversefieldfiltering(content)
                content = striptags(content)
                content = trimstring(content, 148)
                content = toilehighlighter(content, searchfor)
                content = content & "..."

                If pagetype = "web-pages" then
                    If menutype = "1" then              
                        linkname = buildlink("/" & title & "/")             
                    ElseIf menutype = "2" then
                        linkname = buildlink("/" & menuoption & "/" & id & "_" & title & "/")               
                    End If  
                Else

                    linkname = buildlink("/" & pagetype & "/" & id & "_" & title & "/") 

                End If              

                title = toilehighlighter(title, searchfor)

                listingstring = "<h3><a href=""" & linkname & """>" & title & "</a></h3>" & vbcrlf
                listingstring = listingstring & "<p class=""opening""><a href=""" & linkname & """>" & content & "</a></p>" & vbcrlf

                listingstringloop = listingstringloop & listingstring   

            counterleftbox = counterleftbox + 1                 
            rsSearch.MoveNext
            loop
            %>

            <div class="techniquescontainer"<% If counterleftbox < 5 then %> style="height:auto;"<% End If %>>
            <div id="techniquescontent">
            <% =listingstringloop %>        
            </div>
            </div>

            <% End if 

            rsSearch.Close
            Set rsSearch = Nothing  
            %>


            <%

            listingstringloop = ""
            listingstring = ""
            counterleftbox = 0

            strSQL = ""
            strSQL = "SELECT 'web-pages' AS pagetype, pages.pageid AS id, pages.title, pages.content, pages.menutype, pages.menuoption, LIKE (pages.title, pages.content) AGAINST ('" & searchfor & "') AS relevance FROM webpages AS pages "
            strSQL = strSQL & "WHERE pages.modestatus = '1' AND (LIKE(pages.title, pages.content) OR (pages.title like '%" & searchfor & "%') OR (pages.content like '%" & searchfor & "%')) "          
            strSQL = strSQL & "GROUP BY id "
            strSQL = strSQL & "ORDER BY relevance DESC "
            Set rsSearch = my_conn.Execute(strSQL)

            If rsSearch.EOF = False then
            searchrecordin = "Yes"          
            %>          
            <h2 class="section">Web Pages</h2>               
            <%
                Do while NOT rsSearch.eof            

                id = reversefieldfiltering(rsSearch("id"))
                pagetype = reversefieldfiltering(rsSearch("pagetype"))
                title = reversefieldfiltering(rsSearch("title"))
                menutype = reversefieldfiltering(rsSearch("menutype"))
                menuoption = reversefieldfiltering(rsSearch("menuoption"))

                content = rsSearch("content")
                content = reversefieldfiltering(content)
                content = striptags(content)
                content = trimstring(content, 148)
                content = toilehighlighter(content, searchfor)
                content = content & "..."

                If pagetype = "web-pages" then
                    If menutype = "1" then              
                        linkname = buildlink("/" & title & "/")             
                    ElseIf menutype = "2" then
                        linkname = buildlink("/" & menuoption & "/" & id & "_" & title & "/")               
                    End If  
                Else

                    linkname = buildlink("/" & pagetype & "/" & id & "_" & title & "/") 

                End If              

                title = toilehighlighter(title, searchfor)

                listingstring = "   <h3><a href=""" & linkname & """>" & title & "</a></h3>" & vbcrlf
                listingstring = listingstring & "   <p class=""opening""><a href=""" & linkname & """>" & content & "</a></p>" & vbcrlf

                listingstringloop = listingstringloop & listingstring   

            counterleftbox = counterleftbox + 1         
            rsSearch.MoveNext
            loop
            %>

            <div class="webpagescontainer"<% If counterleftbox < 5 then %> style="height:auto;"<% End If %>>
            <div id="webpagescontent">
             <% =listingstringloop %>               
            </div>
            </div>

            <% End if 

            rsSearch.Close
            Set rsSearch = Nothing  
            %>


            <%

            listingstringloop = ""
            listingstring = ""
            counterleftbox = 0

            strSQL = ""
            strSQL = "SELECT 'categories' AS pagetype, cat.categoryid AS id, cat.category AS title, cat.content, 0 AS menutype, '' AS menuoption, LIKE (cat.category, cat.content) AGAINST ('" & searchfor & "') AS relevance FROM categories AS cat "
            strSQL = strSQL & "WHERE (LIKE(cat.category, cat.content) AGAINST ('" & searchfor & "' IN BOOLEAN MODE) OR (cat.category like '%" & searchfor & "%') OR (cat.content like '%" & searchfor & "%')) "                     
            strSQL = strSQL & "GROUP BY id "
            strSQL = strSQL & "ORDER BY relevance DESC "
            Set rsSearch = my_conn.Execute(strSQL)

            If rsSearch.EOF = False then
            searchrecordin = "Yes"          
            %>          
            <h2 class="section">Categories</h2>                  
            <%
                Do while NOT rsSearch.eof            

                id = reversefieldfiltering(rsSearch("id"))
                pagetype = reversefieldfiltering(rsSearch("pagetype"))
                title = reversefieldfiltering(rsSearch("title"))
                menutype = reversefieldfiltering(rsSearch("menutype"))
                menuoption = reversefieldfiltering(rsSearch("menuoption"))

                content = rsSearch("content")
                content = reversefieldfiltering(content)
                content = striptags(content)
                content = trimstring(content, 148)
                content = toilehighlighter(content, searchfor)
                content = content & "..."

                If pagetype = "web-pages" then
                    If menutype = "1" then              
                        linkname = buildlink("/" & title & "/")             
                    ElseIf menutype = "2" then
                        linkname = buildlink("/" & menuoption & "/" & id & "_" & title & "/")               
                    End If  
                Else

                    linkname = buildlink("/" & pagetype & "/" & id & "_" & title & "/") 

                End If

                title = toilehighlighter(title, searchfor)

                listingstring = "   <h3><a href=""" & linkname & """>" & title & "</a></h3>" & vbcrlf
                listingstring = listingstring & "   <p class=""opening""><a href=""" & linkname & """>" & content & "</a></p>" & vbcrlf

                listingstringloop = listingstringloop & listingstring   

            counterleftbox = counterleftbox + 1         
            rsSearch.MoveNext
            loop
            %>

            <div class="categoriescontainer"<% If counterleftbox < 5 then %> style="height:auto;"<% End If %>>
            <div id="categoriescontent" style="width: auto;">
             <% =listingstringloop %>                   
            </div>
            </div>

            <% End if 

            rsSearch.Close
            Set rsSearch = Nothing  


            If searchrecordin = "No" then
            %>
                <p class="opening"><b>We are sorry, but no matches were found matching your search term. Please try a different search term.</b></p>
            <%
            End If

        End If %>

    <div class="clear"></div>
    </div>


    <div class="rightbox">
        <h2>Video Gallery</h2>    

        <%  

        listingstringloop = ""
        listingstring = ""
        counterdiv = 0

        strSQL = ""
        strSQL  = "SELECT 'video-gallery' AS pagetype, vg.videogalleryid AS id, vg.title, vg.videocontent, vg.folderlink, LIKE (vg.title, vg.description) AGAINST ('" & searchfor & "') AS relevance FROM videogallery AS vg "          
        strSQL = strSQL & "WHERE (LIKE(vg.title, vg.description) AGAINST ('" & searchfor & "' IN BOOLEAN MODE) OR (vg.title like '%" & searchfor & "%') OR (vg.description like '%" & searchfor & "%')) "           
        strSQL = strSQL & "GROUP BY id "
        strSQL = strSQL & "ORDER BY relevance DESC "            
        Set rsSearch = my_conn.Execute(strSQL)

        If rsSearch.EOF = False then            

        imagecounter = 1

            Do while NOT rsSearch.eof 

            If imagecounter > 2 then imagecounter = 1

            youtubevideoid = ""

            id = reversefieldfiltering(rsSearch("id"))
            pagetype = reversefieldfiltering(rsSearch("pagetype"))
            videotitle = reversefieldfiltering(rsSearch("title"))
            folderlink = reversefieldfiltering(rsSearch("folderlink"))      
            videocontent = rsSearch("videocontent")
            videocontent = reversefieldfiltering(videocontent)

            regExpVideocontent = Replace(videocontent, "v/","#v=")      
            youtubevideoid = GetFirstMatch("[\\#&]v=([^?#]*)",regExpVideocontent)

            If youtubevideoid = "" then

                regExpVideocontent = GetFirstMatch("<iframe [^>]*src=""(.*?)""[^>]*>",videocontent)
                regExpVideocontent = Replace(regExpVideocontent,"http://www.youtube.com/embed/","")
                regExpVideocontent = Replace(regExpVideocontent,"?rel=0","")
                youtubevideoid = TRIM(regExpVideocontent)
                youtubevideoid = RTRIM(youtubevideoid)
                youtubevideoid = LTRIM(youtubevideoid)

            End If      


            listingstring = "   <a href=""/video-gallery/?a=1&vgid=" & id & """>"
            listingstring = listingstring & "<img src=""/images/transparent.gif"" style=""background-image:url('http://img.youtube.com/vi/" & youtubevideoid & "/1.jpg');background-position:center;"" border=""0"" width=""115"" height=""86"" alt=""" & videotitle & """ title=""" & videotitle & """ "
            If imagecounter = 1 then 
            listingstring = listingstring & "class=""left"""
            Else 
            listingstring = listingstring & "class=""right"""
            End If
            listingstring = listingstring & "/></a>" & vbcrlf

            listingstringloop = listingstringloop & listingstring       

            imagecounter = imagecounter + 1
            counterdiv = counterdiv + 1 
            rsSearch.MoveNext
            loop

          %>

            <div class="videocontainer"<% If counterdiv < 7 then %> style="height:auto;"<% End If %>>
            <div id="videocontent">                
            <% =listingstringloop %>
            </div>
            </div>

          <%
          End if 

          rsSearch.Close
          Set rsSearch = Nothing        
          %>   

    </div>

    <% End If %> 

<div class="clear"></div>
</div>


<!-- #include virtual="/site-elements/template/template-end.asp" -->
<!-- #include virtual="/site-elements/includes/database-close.asp" -->

搜索

您的搜索结果:

照片库 单击图像以查看更大的视图

2然后计数器=1 thisid=reversefieldfiltering(rsSearch(“id”)) thistitle=reversefieldfiltering(rsSearch(“entrytitle”)) imageid=reversefieldfiltering(rsSearch(“imageid”)) pagetype=reversefieldfiltering(rsSearch(“pagetype”)) imagetitle=reversefieldfiltering(rsSearch(“imagetitle”)) listingstring=“” ElseIf pagetype=“news”则 listingstring=listingstring&“
要完整阅读新闻报道,请” 如果结束 listingstring=listingstring&“”“>” listingstring=listingstring&''&vbcrlf listingstringloop=listingstringloop&listingstring 计数器=计数器+1 counterdiv=counterdiv+1 rsSearch.MoveNext 环 %>
如果你想搜索一个单词,那么你可以使用以下方法

在构造SQL之前调用以下行

searchfor = "[^a-zA-Z]" + searchfor + "[^a-zA-Z]"
这里的想法是搜索输入的内容,其中前后都没有字母。例如,如果您输入'at',则它与'car at usa'匹配,但与'cat'不匹配


这不是一个完美的解决方案,但只是一个想法,它可以扩展以排除更多的字符

您可以同时发布后端代码吗?C代码?