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)
 passing names to query
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 03 August 2003 :  17:46:09  Show Profile
it brings up a blank page because you have the line that writes to the page commented out.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 04 August 2003 :  01:33:29  Show Profile  Visit Alfred's Homepage
Ah yes, no wonder!
I uploaded it now as an asp page: tp://www.ggholiday.com/bg/forums/decorated2.asp

I would like to produce each player name, and show his medals next to it, though.

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 04 August 2003 :  06:16:39  Show Profile
Your txt file doesn't match your asp file, but why don't you jsut Response.Write the m_name ? It's in your query.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 04 August 2003 :  13:58:24  Show Profile  Visit Alfred's Homepage
Ok, I updated both the asp and the txt file now.
Got the names in there ok, but I still have to work on getting it so that each name only shows up once, but with all his medals next to it.

PS.: I guess I can't do that, because each is a separate record, and the player name gets repeated for each medal!

Alfred
The Battle Group
CREDO

Edited by - Alfred on 04 August 2003 15:32:29
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 04 August 2003 :  18:35:38  Show Profile
You can do it, you just need to keep track of when the member name changes.

Try this :

- just above your While line add :

currid = mymedals("member_id")

- Remove the Response.Write (but we'll need it shortly)

- After the movenext line, add this :

If currid <> mymedals("member_id") then
*add Response.Write line here*
DisplayMedalIcon = ""
currid = mymedals("member_id")
End If


That may not be exact, but it will be close.
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 04 August 2003 :  21:34:23  Show Profile  Visit Alfred's Homepage
That loos like a neat trick!
But it did give me an error:
quote:
Error Type:
(0x80020009)
Exception occurred.
/BG/forums/decorated2.asp, line 78


asp and txt files are updated again!

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 04 August 2003 :  21:40:47  Show Profile
****!!! I knew I forgot something, this should fix it :

- After the movenext line put this :

if not myMedals.EOF then

- Before the Wend line put this :

End If

You should also change the query so it is sorted by something (member name would probably be best), so something like ....

line 9 looks like :

"INNER JOIN FORUM_MEMBERS M1 ON M1.MEMBER_ID = M.MEMBER_ID;"

change it to look like :

"INNER JOIN FORUM_MEMBERS M1 ON M1.MEMBER_ID = M.MEMBER_ID order by m_name asc;"
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 04 August 2003 :  22:19:52  Show Profile  Visit Alfred's Homepage
It still does not look right.
asp and txt files are updated again!

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 04 August 2003 :  22:23:03  Show Profile
Move this line :

Response.Write mymedals("m_name") & DisplayMedalIcon & "<br>"

to this location :

If currid <> mymedals("member_id") then
Response.Write mymedals("m_name") & DisplayMedalIcon & "<br>"
DisplayMedalIcon = ""
currid = mymedals("member_id")
End If
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 04 August 2003 :  23:35:40  Show Profile  Visit Alfred's Homepage
Still multiple names showing.
asp and txt files are updated again!

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 04 August 2003 :  23:42:06  Show Profile
You sure ??

The only Response.Write line should be just after :

If currid <> mymedals("member_id") then
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 05 August 2003 :  00:15:45  Show Profile  Visit Alfred's Homepage
Well, here it is: http://www.ggholiday.com/bg/forums/decorated2.asp

Alfred
The Battle Group
CREDO
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 05 August 2003 :  00:52:37  Show Profile
Alfred, both the text file and the output from the ASP code indicate that there are Response.Write's outside the IF I have indicated above.

If you look at http://www.ggholiday.com/bg/forums/decorated2.asp you'll notice that the user names are in order (as a result of the ORDER BY clause in the SQL), but the is still multiple lines for each user. This indicates that the currid is not being set properly (all indications is that it is), or that you are outputting the results at the wrong time.

Please review both files and the instructions on this page.

(Can I also say again that using IM will make this a lot simpler ? )
Go to Top of Page

Alfred
Senior Member

USA
1527 Posts

Posted - 05 August 2003 :  12:41:58  Show Profile  Visit Alfred's Homepage
You are right, there was another response.write, which I took out now.
But now we only get Rommel in the display!
Also, he should only show 2 medals, not four.

Alfred
The Battle Group
CREDO

Edited by - Alfred on 05 August 2003 12:43:29
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 05 August 2003 :  17:13:35  Show Profile
OK, my fault there, there are two lines like this :

currid = mymedals("member_id")

change both to this :

currid = mymedals("m_name")

Also change this line :

If currid <> mymedals("member_id") then

to this :

If currid <> mymedals("m_name") then

Update both files and let me know.
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | Next Page
 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.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07