---
title: "Strula me val av utskrift"
type: "forum-thread"
url: "https://www.webforum.nu/amne/asp/52242-strula-me-val-av-utskrift"
topic: "ASP"
topic_url: "https://www.webforum.nu/amne/asp"
author: "Asa"
published: "2002-09-04T21:37:17.000Z"
updated: "2002-09-04T21:52:36.000Z"
replies: 1
views: 175
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/asp/52242-strula-me-val-av-utskrift"
---

# Strula me val av utskrift

## #1 — Asa, 2002-09-04T21:37Z

Har en kod som ska känna av om man valt att vara anonym men den visar användarnamnet iallafall. Nån som ser vad jag gjort fel? Den hämtar rätt inlägg fast den i startad.Första If satsen där man hämtar där userId=" & RS("user") men den visar samma namn på senaste.

<http://www.gruvsjo.com/fm>

```
<%Do While Not RS.EOF%>

   <tr bgcolor="<%=farg%>">
      <td>&nbsp;</td>
      <td><b><a href="forum.asp?id=<%=RS("id")%>"><%=RS("subject")%></b></td>
<%Set User=Conn.Execute("Select * From users Where userId=" & RS("user"))
If RS("statustyp") <> True Then%>
      <td><a href="mem.asp?userid=<%=User("userid")%>"><%=User("username")%></a><br><%If FormatDateTime(RS("date"),2) = FormatDateTime(Now(),2) Then%>Idag (<%=FormatDateTime(RS("date"),4)%>)<%Else%><%=FormatDateTime(RS("date"),2)%> (<%=FormatDateTime(RS("date"),4)%>)<%End If%></td>
<%Else%>
      <td>Anonym<br><%If FormatDateTime(RS("date"),2) = FormatDateTime(Now(),2) Then%>Idag (<%=FormatDateTime(RS("date"),4)%>)<%Else%><%=FormatDateTime(RS("date"),2)%> (<%=FormatDateTime(RS("date"),4)%>)<%End If%></td>
<%End If
User.Close%>
      <td align="center"><%=RS("answers")%></td>
      <td align="center"><%=RS("read")%></td>
<%Set User=Conn.Execute("Select * From users Where userId=" & RS("latestuser"))
If RS("statustyp") <> True Then%>
      <td><a href="mem.asp?userid=<%=User("userid")%>"><%=User("username")%></a><br><%If FormatDateTime(RS("latest"),2) = FormatDateTime(Now(),2) Then%>Idag (<%=FormatDateTime(RS("latest"),4)%>)<%Else%><%=FormatDateTime(RS("latest"),2)%> (<%=FormatDateTime(RS("latest"),4)%>)<%End If%></td>
<%Else%>
      <td>Anonym<br><%If FormatDateTime(RS("latest"),2) = FormatDateTime(Now(),2) Then%>Idag (<%=FormatDateTime(RS("latest"),4)%>)<%Else%><%=FormatDateTime(RS("latest"),2)%> (<%=FormatDateTime(RS("latest"),4)%>)<%End If%></td>
<%End If
User.Close%>
   </tr>

<%x=x+1
RS.MoveNext
Loop%>
```

Permalänk: https://www.webforum.nu/p/52242

## #2 — Asa, 2002-09-04T21:52Z

Löste det med detta:

```
<%Set User=Conn.Execute("Select * From users Where userId=" & RS("user"))%>
      <td><%If RS("statustyp") <> True Then%><a href="mem.asp?userid=<%=User("userid")%>"><%=User("username")%></a><%Else%>Anonym<%End If%><br><%If FormatDateTime(RS("date"),2) = FormatDateTime(Now(),2) Then%>Idag (<%=FormatDateTime(RS("date"),4)%>)<%Else%><%=FormatDateTime(RS("date"),2)%> (<%=FormatDateTime(RS("date"),4)%>)<%End If%></td>
<%User.Close%>
      <td align="center"><%=RS("answers")%></td>
      <td align="center"><%=RS("read")%></td>
<%Set ReS=Conn.Execute("Select * From forum Where uid='" & RS("id") & "' Order By date desc")
Set User=Conn.Execute("Select * From users Where userId=" & ReS("latestuser"))%>
      <td><%If ReS("statustyp") <> True Then%><a href="mem.asp?userid=<%=User("userid")%>"><%=User("username")%></a><%Else%>Anonym<%End If%><br><%If FormatDateTime(RS("latest"),2) = FormatDateTime(Now(),2) Then%>Idag (<%=FormatDateTime(RS("latest"),4)%>)<%Else%><%=FormatDateTime(RS("latest"),2)%> (<%=FormatDateTime(RS("latest"),4)%>)<%End If%></td>
<%User.Close
Res.Close%>
```

Permalänk: https://www.webforum.nu/p/772347

---

Tråden på webben: https://www.webforum.nu/amne/asp/52242-strula-me-val-av-utskrift
