18. august 2003 - 11:37Der er
4 kommentarer og 1 løsning
Random record
<%@LANGUAGE="VBSCRIPT"%> <!--#include file="Connections/capitol.asp" --> <% Dim random_product__MMColParam Dim random_product__MMColParam = "Y" If (Request("MM_EmptyValue") <> "") Then random_product__MMColParam = Request("MM_EmptyValue") End If %> <% Set random_product = Server.CreateObject("ADODB.Recordset") random_product.Open "SELECT * FROM product WHERE Active = '" + Replace (random_product__MMColParam, "'", "''") + "'", MM_capitol_STRING, 1, 3 If random_product.BOF or random_product.EOF Then Response.write "Ingen poster" else randomize random_product.Move(int(random_product.RecordCount + rnd())) 'Response.Write random_product("IDproduct") end if %>
Prøv i førte omgang at rette det til dette hvor Response.write efter The er flyttet ned: Samt lavet om i koden for at finde random recorden.
<% Set random_product = Server.CreateObject("ADODB.Recordset") random_product.Open "SELECT * FROM product WHERE Active = '" + Replace (random_product__MMColParam, "'", "''") + "'", MM_capitol_STRING, 1, 3 If random_product.BOF or random_product.EOF Then Response.write "Ingen poster" else randomize randomNr = Int(random_product.RecordCount * rnd()) random_product.Move(randomNr) Response.Write random_product("IDproduct") end if %>
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.