C
Christo
I have this script for showing news on a page, but i want it to only
show the last 10 records, as in the 10 records that were added to the
database last. the script shows the entries in descending order. Here
is a code snippet
Do While not rsNews.EOF
Response.Write("<table class=""tableborder"" border=""0""
cellspacing=""0"" cellpadding""0"" width=""100%"" ")
Response.Write("<tr>")
Response.Write("<td class=""tabletitle"" width=""100%"">")
Response.Write(rsNews("Title"))
Response.Write(" Posted on ")
Response.Write(rsNews("Date"))
Response.Write("</td></tr>")
Response.Write("<tr>")
Response.Write("<td class=""normal"" width=""100%"">")
Response.Write(rsNews("Body"))
Response.Write("</td></tr></table><br><br>")
rsNews.MoveNext
Loop
i tried adding a counter and making this
counter = 0
Do While not rsNews.EOF AND Counter <=10
'Response.Write code
counter = counter + 1
Loop
this didnt work either, Anyone know how i can do this? isnt there a way
to do it with an sql query?
any help much appreciated, thanks
Chris
show the last 10 records, as in the 10 records that were added to the
database last. the script shows the entries in descending order. Here
is a code snippet
Do While not rsNews.EOF
Response.Write("<table class=""tableborder"" border=""0""
cellspacing=""0"" cellpadding""0"" width=""100%"" ")
Response.Write("<tr>")
Response.Write("<td class=""tabletitle"" width=""100%"">")
Response.Write(rsNews("Title"))
Response.Write(" Posted on ")
Response.Write(rsNews("Date"))
Response.Write("</td></tr>")
Response.Write("<tr>")
Response.Write("<td class=""normal"" width=""100%"">")
Response.Write(rsNews("Body"))
Response.Write("</td></tr></table><br><br>")
rsNews.MoveNext
Loop
i tried adding a counter and making this
counter = 0
Do While not rsNews.EOF AND Counter <=10
'Response.Write code
counter = counter + 1
Loop
this didnt work either, Anyone know how i can do this? isnt there a way
to do it with an sql query?
any help much appreciated, thanks
Chris