Author |
Topic  |
Nikkol
Forum Moderator
    
USA
6907 Posts |
|
Alfred
Senior Member
   
USA
1527 Posts |
Posted - 04 August 2003 : 01:33:29
|
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
|
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 04 August 2003 : 06:16:39
|
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. |
 |
|
Alfred
Senior Member
   
USA
1527 Posts |
Posted - 04 August 2003 : 13:58:24
|
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 |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 04 August 2003 : 18:35:38
|
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. |
 |
|
Alfred
Senior Member
   
USA
1527 Posts |
Posted - 04 August 2003 : 21:34:23
|
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
|
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 04 August 2003 : 21:40:47
|
****!!! 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;"
|
 |
|
Alfred
Senior Member
   
USA
1527 Posts |
Posted - 04 August 2003 : 22:19:52
|
It still does not look right. asp and txt files are updated again!
|
Alfred The Battle Group CREDO
|
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 04 August 2003 : 22:23:03
|
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
|
 |
|
Alfred
Senior Member
   
USA
1527 Posts |
Posted - 04 August 2003 : 23:35:40
|
Still multiple names showing. asp and txt files are updated again! |
Alfred The Battle Group CREDO
|
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 04 August 2003 : 23:42:06
|
You sure ??
The only Response.Write line should be just after :
If currid <> mymedals("member_id") then
|
 |
|
Alfred
Senior Member
   
USA
1527 Posts |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 05 August 2003 : 00:52:37
|
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 ? ) |
 |
|
Alfred
Senior Member
   
USA
1527 Posts |
Posted - 05 August 2003 : 12:41:58
|
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 |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 05 August 2003 : 17:13:35
|
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. |
 |
|
Topic  |
|