|
|
|
|
<%
SQL="SELECT TOP 2 Produtos.*, Categorias.nome_categoria FROM Categorias INNER JOIN Produtos ON Categorias.codigo_categoria=Produtos.codigo_categoria where Produtos.vitrine=true and (Categorias.nome_categoria='Computadores' or Categorias.nome_categoria='Computador') and Produtos.disponivel>0 "
SQL = SQL & " ORDER BY Produtos.nome_produto"
Set Comp = DB.execute(SQL)
If Comp.EOF=False Then
%>
|
|
<%
Comp.movenext
End If
%>
|
|
<%If Comp.Eof=False Then%>
|
|
<%End If
Comp.close
Set Comp = Nothing
%>
|
|
|
|
|
|
<%
SQL="SELECT Produtos.*, Categorias.nome_categoria FROM Categorias INNER JOIN Produtos ON Categorias.codigo_categoria=Produtos.codigo_categoria where Produtos.vitrine=true and Produtos.disponivel>0"
SQL = SQL & " ORDER BY Produtos.nome_produto asc"
Function Dados(Instrucao)
Dados = DB.Execute(Instrucao).GetRows()
End Function
Dim SQL
Dim arrDados
Dim intI
arrDados = Dados(SQL)
x = UBound(arrDados,2)
For i=0 to 4
Randomize
intI=CInt(Rnd()* x)
codigo = arrDados(0,intI)
categoria = arrDados(1,intI)
nome = arrDados(2,intI)
descricao = arrDados(3,intI)
preco = arrDados(4,intI)
imagem = arrDados(5,intI)
%>
|
|
|
|
<%
next
%>
|