Avatar billede realone Nybegynder
08. april 2003 - 18:01 Der er 4 kommentarer og
1 løsning

adde ID i acces-db

Hej eksperter.
Jeg har hentet et clanwar-script til min clan's hjemmeside. Det kører for så vidt fint nok, men selv om der i acces-db'en er et felt der hedder "WarID", kommer der intet i dem.
Dvs, at når jeg i højre side af siden vil trække de 5 seneste kampe ud, skriver den alle kampe ud, da der ikke er nogen "top 5", da der ikke ER nogen ID's.

Koden er som følger:

<!--#include file="protect.inc"-->
<!--#include file="dataconn.asp"-->
<%
strGame = Session("ID")


    Set rs = Server.CreateObject("ADODB.RecordSet")
    strSQL = "SELECT * FROM users WHERE clanid LIKE '%" & StrGame & "%'"
   
    rs.Open strSQL, myConn, 1, 3
   

   
    Set rs2 = Server.CreateObject("ADODB.RecordSet")
    strSQL = "SELECT * FROM cw_league order by name"
   
    rs2.Open strSQL, myConn, 1, 3
   

%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<!--#include file="JavaScript.asp"-->
<HEAD>
<TITLE>Control Panel -> Add a New Played War</TITLE>
<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<LINK href="style.css" type=text/css rel=StyleSheet></HEAD>
<BODY bgColor=#B4B7CA leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#b4b7ca border=0>
  <TBODY>
  <TR>
    <TD vAlign=top align=left width="65%" bgColor=#b4b7ca></TD>
    <FONT class=content>
    <TD vAlign=top align=right
bgColor=></SELECT></FONT></TD></FORM></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center bgColor=#f3f4f7
border=0>
  <TBODY>
  <TR>
    <TD bgColor=#ffffff colSpan=4><IMG height=1 alt="" hspace=0
      src="images/pixel.gif" width=1 border=0></TD></TR>
  <TR vAlign=center bgColor=#e0e2eb>
    <TD vAlign=top align=left width=8 height=22><IMG
      src="images/topnav-left.gif"></TD>
    <TD noWrap width="15%"
    background="images/topnav-bg.gif"><FONT
      class=content color=#363636>&nbsp;&nbsp;</FONT></TD>
    <TD align=middle width="73%"
    background="images/topnav-bg.gif" height=20>&nbsp;</TD>
    <TD vAlign=top align=left width=8 height=22><IMG
      src="images/topnav-left.gif"></TD>
    <TD align=right width=140
    background="images/topnav-bg.gif"><FONT
      class=content>
      <SCRIPT type=text/javascript>

<!--  // Array ofmonth Names
var monthNames = new Array( "January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
thisYear = now.getYear();
if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem
document.write(monthNames[now.getMonth()] + " " + now.getDate() + ", " + thisYear);
// -->

    </SCRIPT>
      </FONT>&nbsp;</TD></TR>
  <TR>
    <TD bgColor=#e0e2eb colSpan=5><IMG height=3 alt="" hspace=0
      src="images/pixel.gif" width=1 border=0></TD></TR>
  <TR>
    <TD bgColor=#aca899 colSpan=5><IMG height=1 alt="" hspace=0
      src="images/pixel.gif" width=1 border=0></TD></TR>
  <TR>
    <TD bgColor=#716f64 colSpan=5><IMG height=1 alt="" hspace=0
      src="images/pixel.gif" width=1
  border=0></TD>
  </TR>
  </TBODY>
  </TABLE>
  <!----- Begin Main Content Table ----->
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center bgColor=#b4b7ca
border=0>
  <TBODY>
  <TR vAlign=top>
    <TD bgColor=#b4b7ca><IMG height=1 alt=""
      src="images/pixel.gif" width=10 border=0></TD>
    <TD vAlign=top width=175 bgColor=#b4b7ca><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width=26 height=30><IMG
                  src="images/sidebox-title-left.gif"></TD>
                <TD vAlign=center align=left width=143
                background="images/sidebox-title-bg.gif"
                height=30><FONT class=option color=#ffffff>&nbsp;&nbsp;<B>Main
                  Navigation</B></FONT></TD>
                <TD vAlign=top align=left width=6 height=30><IMG
                  src="images/sidebox-title-right.gif"></TD>
                  </TR>
                  </TBODY>
                  </TABLE>
                  </TD>
                  </TR>
                  </TBODY>
                  </TABLE>
                  <!----- Side Box Content ----->
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR vAlign=top>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-left.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD>
          <TD vAlign=top align=left width=166 bgColor=#f0f1f5>
            <TABLE cellSpacing=0 cellPadding=3 width=166 border=0>
              <TBODY>
              <TR>
                <TD><BIG><STRONG>·</STRONG></BIG><a title="Back Home" href="home.asp">Home</a></TD></TR></TBODY></TABLE></TD>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-right.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=left width=175 height=29><IMG
            src="images/sidebox-bottom.gif">
      </TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width=26 height=30><IMG
                  src="images/sidebox-title-left.gif"></TD>
                <TD vAlign=center align=left width=143
                background="images/sidebox-title-bg.gif"
                height=30><FONT class=option
                  color=#ffffff>&nbsp; Login as</FONT></TD>
                <TD vAlign=top align=left width=6 height=30><IMG
                  src="images/sidebox-title-right.gif"></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!----- Side Box Content ----->
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR vAlign=top>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-left.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD>
          <TD vAlign=top align=left width=166 bgColor=#f0f1f5>
            <TABLE cellSpacing=0 cellPadding=3 width=166 border=0>
              <TBODY>
              <TR>
                <TD>Level: <%=RS("level")%>

               
                <br>
                Username: <%=Session("Username")%> </TD></TR></TBODY></TABLE></TD>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-right.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=left width=175 height=29><IMG
            src="images/sidebox-bottom.gif">
      </TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width=26 height=30><IMG
                  src="images/sidebox-title-left.gif"></TD>
                <TD vAlign=center align=left width=143
                background="images/sidebox-title-bg.gif"
                height=30><FONT class=option
                  color=#ffffff>&nbsp;&nbsp;ClanWars</FONT></TD>
                <TD vAlign=top align=left width=6 height=30><IMG
                  src="images/sidebox-title-right.gif"></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!----- Side Box Content ----->
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR vAlign=top>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-left.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD>
          <TD vAlign=top align=left width=166 bgColor=#f0f1f5>
            <TABLE cellSpacing=0 cellPadding=3 width=166 border=0>
              <TBODY>
              <TR>
                <TD>
                  <p align="left">    <% If RS("clanwarscript") = "1" Then
    Response.Write "<STRONG><BIG>·</BIG></STRONG> <a href=""show_wars.asp"">Show Wars</a>"
    Response.Write "<br>"
    Response.Write "<STRONG><BIG>·</BIG></STRONG> <a href=""add_war.asp"">Add ClanWar</a>"
    Response.Write "<br>"
    Response.Write "<STRONG><BIG>·</BIG></STRONG> <a href=""Scheduled_War.asp"">Add Scheduled War</a>"
    Else
    Response.Write "<STRONG><BIG>·</BIG></STRONG> <strike>Show Wars</strike>"
    Response.Write "<br>"
    Response.Write "<STRONG><BIG>·</BIG></STRONG> <strike>Add ClanWar</strike>"
    Response.Write "<br>"
    Response.Write "<STRONG><BIG>·</BIG></STRONG> <strike>Add Scheduled War</strike>"
    End If
   
    %></TD></TR></TBODY></TABLE></TD>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-right.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=left width=175 height=29><IMG
            src="images/sidebox-bottom.gif">
      </TD></TR></TBODY></TABLE><BR>
      </TD>
    <TD bgColor=#b4b7ca><IMG height=1 alt=""
      src="images/pixel.gif" width=15 border=0></TD>
    <TD bgColor=#b4b7ca><IMG height=1 alt=""
      src="images/pixel.gif" width=15 border=0></TD>
    <TD width="100%">
      <TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#b4b7ca
        border=0><TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=1 cellPadding=8 width="100%" bgColor=#f0f1f5
            border=0>
              <TBODY>
              <TR>
                <TD>
                  <CENTER>
                  <span style="font-weight: 700; background-position: 0% 0%">
                  Clan Control Panel For <%=RS("clanname")%></span></CENTER></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR><BR>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff
        border=0><TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width=26 height=30><IMG
                  src="images/sidebox-title-left.gif"></TD>
                <TD vAlign=center align=left width="100%"
                background="images/sidebox-title-bg.gif"
                height=30><FONT class=option
                  color=#363636>&nbsp; Add a New Played War</FONT></TD>
                <TD vAlign=top align=left width=6 height=30><IMG
                  src="images/sidebox-title-right.gif"></TD></TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR>
                      <TD vAlign=top align=left width=4
                      background="images/sidebox-bar-left.gif"><IMG
                        src="images/sidebox-bar-px.gif"></TD>
                      <TD>
                        <TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
                          <TBODY>
                          <TR vAlign=top>
                            <TD>
    <!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.opponent.value == "")
  {
    alert("Skriv en værdi for feltet \"opponent\".");
    theForm.opponent.focus();
    return (false);
  }

  if (theForm.homepage.value == "")
  {
    alert("Skriv en værdi for feltet \"homepage\".");
    theForm.homepage.focus();
    return (false);
  }

  if (theForm.Maps.value == "")
  {
    alert("Skriv en værdi for feltet \"Maps\".");
    theForm.Maps.focus();
    return (false);
  }

  if (theForm.uspoints.value == "")
  {
    alert("Skriv en værdi for feltet \"uspoints\".");
    theForm.uspoints.focus();
    return (false);
  }

  if (theForm.thempoints.value == "")
  {
    alert("Skriv en værdi for feltet \"thempoints\".");
    theForm.thempoints.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan --><form method="POST" action="ClanWar-exe.asp" onsubmit="return FrontPage_Form1_Validator(this)" language="JavaScript" name="FrontPage_Form1">
      <table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
        <tr>
          <td width="33%">Result:</td>
          <td width="67%" colspan="3">
          <b><font size="2">
      <select size="1" name="result" style="border-style: dotted; border-width: 1; background-color: #B4B7CA">
      <option value="Draw" selected>Draw</option>
      <option value="Won">Won</option>
      <option value="Lost">Lost</option>
      </select></font></b></td>
        </tr>
        <tr>
          <td width="33%">Played on date:</td>
          <td width="16%">
    <font><b><select size="1" name="mday" style="border-style: dotted; border-width: 1; background-color: #B4B7CA">
      <option value="01" selected>01</option>
      <option value="02">02</option>
      <option value="03">03</option>
      <option value="04">04</option>
      <option value="05">05</option>
      <option value="06">06</option>
      <option value="07">07</option>
      <option value="08">08</option>
      <option value="09">09</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
      <option value="13">13</option>
      <option value="14">14</option>
      <option value="15">15</option>
      <option value="16">16</option>
      <option value="17">17</option>
      <option value="18">18</option>
      <option value="19">19</option>
      <option value="20">20</option>
      <option value="21">21</option>
      <option value="22">22</option>
      <option value="23">23</option>
      <option value="24">24</option>
      <option value="25">25</option>
      <option value="26">26</option>
      <option value="27">27</option>
      <option value="28">28</option>
      <option value="29">29</option>
      <option value="30">30</option>
      <option value="31">31</option>
      </select> DD</b></font></td>
          <td width="16%">
    <small><b><select size="1" name="mmonth" style="border-style: dotted; border-width: 1; background-color: #B4B7CA">
      <option value="01" selected>01</option>
      <option value="02">02</option>
      <option value="03">03</option>
      <option value="04">04</option>
      <option value="05">05</option>
      <option value="06">06</option>
      <option value="07">07</option>
      <option value="08">08</option>
      <option value="09">09</option>
      <option value="10">10</option>
      <option value="11">11</option>
      <option value="12">12</option>
      </select> MM </b></td>
          <td width="36%">
    <small><b><select size="1" name="myear" style="border-style: dotted; border-width: 1; background-color: #B4B7CA">
      <option value="2002">2002</option>
      <option value="2003">2003</option>
      <option value="2004">2004</option>
      <option value="2005">2005</option>
      </select> YYYY</b></td>
        </tr>
        <tr>
          <td width="33%">Opponent Clan name:</td>
          <td width="67%" colspan="3">
   
      <!--webbot bot="Validation" b-value-required="TRUE" --><input name="opponent" size="29" style="border-style: dotted; border-width: 1; background-color: #B4B7CA"></td>
        </tr>
        <tr>
          <td width="33%">Opponent Clan homepage:</td>
          <td width="67%" colspan="3">
   
      <!--webbot bot="Validation" b-value-required="TRUE" --><input name="homepage" size="29" style="border-style: dotted; border-width: 1; background-color: #B4B7CA" value="http://"></b></font></td>
        </tr>
        <tr>
          <td width="33%">Played Maps:</td>
          <td width="67%" colspan="3">
   
      <!--webbot bot="Validation" b-value-required="TRUE" --><input name="Maps" size="29" style="border-style: dotted; border-width: 1; background-color: #B4B7CA">
    <FONT class=content>
      etc. map1, map2</FONT></td>
        </tr>
        <tr>
          <td width="33%">League/Friendly:</td>
          <td width="67%" colspan="3">
    <font face="Tahoma"><b><select size="1" name="league" style="border-style: dotted; border-width: 1; background-color: #B4B7CA">
      <% Do While Not rs2.EOF %>
      <option value="<%=RS2("name")%>"><%=RS2("name")%></option>
      <%rs2.Movenext
    Loop   
%>
      </select> </b><a href="java script:add('Add-League.asp')">Add new League</a></font></td>
        </tr>
        <tr>
          <td width="33%">The End Score:</td>
          <td width="67%" colspan="3">
    Us: <b><!--webbot bot="Validation" b-value-required="TRUE" --><input size="3" name="uspoints" style="border-style: dotted; border-width: 1; background-color: #B4B7CA"> </b>
    Them: <b><!--webbot bot="Validation" b-value-required="TRUE" --><input size="3" name="thempoints" style="border-style: dotted; border-width: 1; background-color: #B4B7CA"></b></td>
        </tr>
        <tr>
          <td width="33%">Report URL:</td>
          <td width="67%" colspan="3">
    <font face="Tahoma"><b>
      <input name="report" size="29" style="border-style: dotted; border-width: 1; background-color: #B4B7CA" value="Nope"></b></font></td>
        </tr>
        </table>
      <p align="center">
      <input type="submit" value="Save War" name="B1" style="border-style: dotted; border-width: 1; background-color: #B4B7CA"></p>
      <input type="hidden" name="ClanID" value="<%=Session("ID")%>">
      <input type="hidden" name="Clanname" value="<%=RS("clanname")%>">
    </form>
&nbsp;</TD></TR></TBODY></TABLE>
                        </TD>
                      <TD vAlign=top align=left width=13
                      background="images/storybox-content-right.gif"><IMG
                        src="images/storybox-content-right-px.gif"></TD></TR></TBODY></TABLE>
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
                    <TR vAlign=top>
                      <TD vAlign=top align=left width=9 height=29><IMG
                        src="images/storybox-bottom-left.gif"></TD>
                      <TD width="100%"
                      background="images/storybox-bottom-bg.gif"
                      height=29>&nbsp;</TD>
                      <TD vAlign=top align=left width=18 height=29><IMG
                        src="images/storybox-bottom-right.gif"></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
     
     
      <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff
        border=0><TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff
        border=0><TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD>
    <TD><IMG height=1 alt="" src="images/pixel.gif"
      width=15 border=0></TD>
    <TD vAlign=top width=150><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=left width=175 height=29>&nbsp;</TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width=26 height=30><IMG
                  src="images/sidebox-title-left.gif"></TD>
                <TD vAlign=center align=left width=143
                background="images/sidebox-title-bg.gif"
                height=30><FONT class=option color=#ffffff>&nbsp;&nbsp;Status</FONT></TD>
                <TD vAlign=top align=left width=6 height=30><IMG
                  src="images/sidebox-title-right.gif"></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!----- Side Box Content ----->
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR vAlign=top>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-left.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD>
          <TD vAlign=top align=left width=166 bgColor=#f0f1f5>
            <TABLE cellSpacing=0 cellPadding=3 width=166 border=0>
              <TBODY>
              <TR>
                <TD>
                  <FONT class=content>
                  ClanWar Script is:
<% If RS("clanwarscript") = "1" Then
Response.Write "<font color=""#00FF00""><b>On</b></font>"
Else
Response.Write "<font color=""#FF0000""><b>Off</b></font>"
End If
%>                 
</FONT></TD></TR></TBODY></TABLE></TD>
          <TD vAlign=top align=left width=4
          background="images/sidebox-bar-right.gif"><IMG
            src="images/sidebox-bar-px.gif"></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=left width=175 height=29><IMG
            src="images/sidebox-bottom.gif">
      </TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=175 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=left width=175 height=29>&nbsp;</TD></TR></TBODY></TABLE><BR>
      </TD>
    <TD bgColor=#b4b7ca><IMG height=1 alt=""
      src="images/pixel.gif" width=10 border=0>
  </TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center bgColor=#f0f1f5
border=0>
  <TBODY>
  <TR align=middle>
    <TD width="100%" colSpan=3 bgcolor="#B4B7CA">
      <CENTER><FONT class=tiny><BR>
      <DIV align=center></A></DIV></FONT></CENTER></TD></TR></TBODY></TABLE></FONT>
      <!--#include file="bund.asp"-->
      </BODY>
      </HTML>
<%
myConn.Close
Set myConn = Nothing
%>

------------------------------------------------------------
er der ikke en flink sjæl der vil hjælpe mig med en rettelse i koden så jeg får ID med?

På forhånd tak :)
</RealOne>
Avatar billede somaliomar Praktikant
08. april 2003 - 18:14 #1
Hvordan ser din SQL-sætning når du henter de seneste 5 kampe? Du behøver ikke bruge ID-feltet når du henter posterne. Hvis du har et dato-felt kan du gøre sådan her:

SELECT TOP 5 Felt1, Felt2 FROM Tabel ORDER BY DataFelt1
Avatar billede realone Nybegynder
08. april 2003 - 18:16 #2
<table border="0" width="130">
<tr valign="top">
<td width="130">
<span class="side"><B>5</B> seneste</span>
</td>
</tr>
<% Set rs = Conn.Execute("select top 5 * from played_war order by warid desc ")
%>
<% Do until rs.eof %>
<tr valign="top">
<td width="90">
<%=rs("opponent")%>
</td>
<td width="40">
<%
If RS("Result") = "Won" Then
response.write("<font color=""#008040"">won</font>")
END IF
%> <%
If RS("Result") = "Lost" Then
response.write("<font color=""#D70000"">lost</font>")
End If
%> <%
If RS("Result") = "Draw" Then
response.write("<font color=""#484848"">draw</font>")
End If
%>
</td>
</tr>




            <%
                            rs.movenext
                            loop
                            rs.close
                            set rs = nothing
                            %>
</table>
Avatar billede realone Nybegynder
08. april 2003 - 18:17 #3
ved ikke hvad jeg ellers skal sortere efter, da warID for mig ser ud til at være det eneste felt, hvor jeg er sikker på at den nyeste kommer øverst og resten ned efter i den rigtige rækkefølge.
Avatar billede realone Nybegynder
08. april 2003 - 19:07 #4
slet ikke nogen der kan hjælpe?
Avatar billede myanimalfarm Nybegynder
09. april 2003 - 10:47 #5
Hvis din ID er sat til autonummerering i databasen skulle det virke hvis du i din SQL bare skriver at den skal sortere descending, så kan du lave en repeat region hvor du siger den skal vise 5 records.

Hjælper det??
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester