I am trying to build a script that can display 5 random records from a table. I got this so far but it only displays the first 5 records. How can i set it up to get a random record each time the page is loaded.
Code:
<%
Dim strSQL, strURL, strSITE
strSQL = "Select * FROM linkdump LIMIT 5"
SET DbObj = Server.CreateObject("ADODB.Connection")
DbObj.Open "Driver={MySQL ODBC 3.51 Driver};"
SET oRs = DbObj.Execute(strSQL)
DO WHILE NOT oRs.EOF
strURL = oRs("link")
strSITE = oRs("site")
Response.Write "<a href=""" & strURL & """ target=""_blank"">" & strSITE & "</a><br>" & vbCrLf
oRs.MoveNext
Loop
DbObj.Close
SET DbObj = Nothing
%>
