webForumDet fria alternativet

Sortera efter datum?

5 svar · 199 visningar · startad av Ivar

IvarMedlem sedan aug. 2002218 inlägg
#1

Hej!
Jag vill att senaste inlägget hamnar överst hur gör man?
Nuvarande kod:
<%
dim connect, classifieds, query, category
category = trim(request("category"))
if ("category") = "" then
Response.write "Ingen categori vald.<p>"
else
set connect = server.createobject("ADODB.connection")
Connect.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db/annonser.mdb") & ";pwd=;"
query = "select id,item,price,stad,datecreated from items "
query = query & "where category='" & category & "'"
set classifieds = connect.execute(query)
%>
<font size="4"><b>
<% if category="categori1" then %>
<% elseif category="categori2" then %>
<%=categori2%>
<% elseif category="categori3" then %>
<%=categori3%>
<% elseif category="categori4" then %>
<%=categori4%>
<% elseif category="categori5" then %>
<%=categori5%>
<% end if %>
</b></font>
<table border=0 bgcolor=#FFFFFF width=100% cellspacing=0 cellpadding=0 bordercolor=#FFFFFF align="center">
<tr bgcolor="#CCCCCC">
<th align=left width="35%">Föremål</th>
<th align=left width="18%">Pris</th>
<th align=left width="24%">Stad</th>
<th align=left width="23%">Datum</th
</tr>
<% do while not classifieds.EOF %>
<tr>
<td width="35%"> <a href=detail.asp?item=<%=classifieds("id")%>>
<%=classifieds("item")%></a></td>
<td width="18%"><%=classifieds("price")%></td>
<td width="24%"><%=classifieds("stad")%></td>
<td width="23%"><%=classifieds("datecreated")%></td>
</tr>
<% classifieds.movenext
loop
end if
%>

Jesper TMedlem sedan nov. 20017 144 inlägg
#2

Inte dubbelposta tack.

IvarMedlem sedan aug. 2002218 inlägg
#3

Sory det blev fel.

IvarMedlem sedan aug. 2002218 inlägg
#4

Kan ni ta bort inlägget?
Som sagt det blev fel .
MVH/Ivar

OveRRidEMedlem sedan feb. 200112 078 inlägg
#5

Ta bort vilket inlägg? Är det en korspostning vi talar om, för någon dubbelpostning finns det inte i denna tråden iallafall. :)

MVH
OveRRidE

moderator, webForum

IvarMedlem sedan aug. 2002218 inlägg
#6

Nej men jag rockade finna mig i Jespers T tråd i stället för att skapa ny.

137 ms totalt · 3 externa anrop · v20260731065814-full.3ab8d573
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
133 ms — hämta tråd, inlägg och bilagor (db)