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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 v33 BUG+FIX?: Members search in members.asp
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 15 December 2001 :  02:21:53  Show Profile
Let's see if I can explain this one. In members.asp, around line 121, you will see this bit of code:
if srchInitial = "1" then 
tmpSQL = strMemberTablePrefix & "MEMBERS.M_NAME LIKE '" & SearchName & "%'"
end if

Now, the code that comes before this piece is building the "WHERE" clause of the SQL query. For example:
if srchLName = "1" then
if srchFName = "1" or srchUName = "1" then
tmpSql = tmpSql & " OR "
end if
tmpSql = tmpSql & strMemberTablePrefix & "MEMBERS.M_LASTNAME LIKE '%" & SearchName & "%' "
end if
Now if you notice, the SQL query is being built by adding to the value that is already in the variable tmpSql. But if you look at the first code I posted:
tmpSQL = strMemberTablePrefix & "MEMBERS.M_NAME LIKE '" & SearchName & "%'"
it doesn't add to the tmpSql variable, it replaces everything that is stored in it, searching for only the 'M_NAME'.

I would think that the srchInitial variable will not be set to 1, when the user is searching by Username, FirstName or by LastName using the form. srchInitial is set to 1 when the user clicks on one of the lettered links to search for a username starting with that letter. If you use the form to search for a username, firstname or lastname after clicking on of the lettered links, it will always search for the username, since the variable srchInitial was set to 1 and never set to 0 in the code.

For instance, click on one of the lettered links in the members search. Then try doing a search using the form and go button, searching by the lastname or firstname. You will notice it will search just by the username and not by the option you selected.

My suggested fix would be to change this:
<input type="hidden" name="initial" value="<%= srchInitial %>">
to this:
<input type="hidden" name="initial" value="0">
That sets srchInitial to 0 when using the form to search. srchInitial is only needed when using the lettered links to search for a username.

- David

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 15 December 2001 :  05:23:57  Show Profile  Visit HuwR's Homepage
Agreed I must have overlooked it when adding the search to the members page.

There is also a bug with paging, which I am about to fix, will post details later.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 15 December 2001 :  05:53:06  Show Profile  Visit HuwR's Homepage
Thanks Richard, have sent you back the fixed one.

To fix the paging problem, the following three lines need to be added to the paging2() function,

Response.write(" <input type=""hidden"" name=""UserName"" value=""" & srchUName & """>" & vbNewLine)
Response.write(" <input type=""hidden"" name=""FirstName"" value=""" & srchFName & """>" & vbNewLine)
Response.write(" <input type=""hidden"" name=""LastName"" value=""" & srchLName & """>" & vbNewLine)

add them below this line

Response.Write(" <input type=""hidden"" name=""M_NAME"" value=""" & searchName & """>" & vbNewLine)


Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 28 December 2001 :  22:44:27  Show Profile
fixed in v3.4
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.52 seconds. Powered By: Snitz Forums 2000 Version 3.4.07