Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Need help with searching....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 10 November 2001 :  02:56:19  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Ok, heres the code I have... The problem is when someone selects to search for 'all' the words, NOTHING shows up no matter what is searched for... code below and description of all the variables...

Variables:
srchStringSize = size of the search query (array)
srchString1(I) = a single word of the query
srchIn = field of the database to search in
srchMatch = search for any of the keywords or all of them... any = 'OR' and all = 'AND'
ModSearchDisplay = output string


For I = 0 to srchStringSize
if not(Trim(srchString1(I)) = "") then
srchString1(I) = replace(srchString1(I), "'", "''")
srchString1(I) = replace(srchString1(I), Chr(34), """")

If I > 0 then
if srchIn = "all" then
strsql = strsql & " OR "
else
strsql = strsql & " " & srchMatch & " "
end if
end if
'Select SQL here
If srchIn = "all" then
strsql = strsql & "(AUTHOR LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" DESCRIPTION LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" MODNAME LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" NAME LIKE '%" & srchString1(I) & "%' " & srchMatch & _
" SVERSION LIKE '%" & srchString1(I) & "%') "
else
strsql = strsql & " " & srchIn & " LIKE '%" & srchString1(I) & "%'"
end if

else
ModSearchDisplay = ModSearchDisplay & "<tr><td bgcolor=""" & strForumCellColor & """ colspan=4>You must enter a query</td></tr>"
end if
Next



If needbe I can post the entire Sub

----------
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, and Huw's modified code
Need a Mod? Check out the Mod Resource

Edited by - da_stimulator on 10 November 2001 03:04:47

redbrad0
Advanced Member

USA
3725 Posts

Posted - 10 November 2001 :  12:26:02  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
did you get this to work? i thought i ran the search and used search all and it worked.

Brad
Web Hosting with SQL Server @ $24.95 per month
Snitz Mod Archive

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 10 November 2001 :  16:14:10  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
No I didnt get it working :( I made some modifications after I initially released the search page, and I think I screwed something up (I added the 'all' to the fields selection)

Maybe you could download the file and look at it yourself? subs.asp - I forget the name of the sub but its near the bottom of the script.

----
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, Huw's code, and Davio's code
Need a Mod? Check out the Mod Resource
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 11 November 2001 :  04:15:05  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
well i just got home and its 2:30 so. i have to wake up early to do some work tommorow. I will try and look at it tommorow.

Brad
Web Hosting with SQL Server @ $24.95 per month
Snitz Mod Archive

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.66 seconds. Powered By: Snitz Forums 2000 Version 3.4.07