Jump to content
Fórum Script Brasil
  • 0

PROBLEMA COM ARRAY DINAMICO


MRV

Question

Olá pessoal!

Estou precisando de ajuda para o seguinte problema: preciso relacionar uma consulta a duas tabelas em banco de dados. Uma chama todos os ids (friends_id) de usuários que estão relacionados entre si. Na outra tabela, preciso chamar todos os vídeos que foram postados pelos "ids amigos". Estou tentando o seguinte código, mas não está dando certo.

<!-- #include file = "conexaoVideos.inc" -->

<%

canalNameURL = "http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL")

Set objRS_Friends = Server.CreateObject("ADODB.Recordset")

ConSQL_Friends = "SELECT * FROM friends WHERE USER_CANALVIDEOURL LIKE '"&canalNameURL&"';"

set objRS_Friends = conexaoVideos.Execute(ConSQL_Friends)

Dim arrayFriends()

ReDim arrayFriends(objRS_Friends.recordcount)

While Not objRS_Friends.EOF

arrayFriends(i) = objRS_Friends.Fields("FRIEND_ID")

i=i+1

objRS_Friends.MoveNext

Wend

Set objRS_Videos = Server.CreateObject("ADODB.Recordset")

ConSQL_Videos = "SELECT * FROM videos WHERE userID LIKE '"&arrayFriends&"';"

set objRS_Videos = conexaoVideos.Execute(ConSQL_Videos)

While Not objRS_Videos.EOF

videoID = objRS_Videos("videoID")

canalName = objRS_Videos("canalName")

videoName = objRS_Videos("videoName")

videoData = objRS_Videos("videoData")

videoThumb = objRS_Videos("videoThumb")

objRS_Videos.MoveNext

Wend

%>

<html>

<head>

<title>#</title>

<link rel="stylesheet" href="CSS/estilos.css" type="text/css">

</head>

<body bgcolor="" leftmargin="1" topmargin="0">

<center>

<table border="0" width="650" cellspacing="0" bgColor="">

<tr>

<td valign="middle" class="txt7" width="30%">

<a class="link7" href="#"><%=canalName%></a> postou em <%=videoData%>

</td>

<td valign="middle" align="center" width="20%">

<a href="#" target="_top"><img src="" width="80" height="45" border="0"></a>

</td>

<td valign="middle" class="txt7" width="50%">

<a class="link7" <a href="" target="_top"> <%=videoName%></a>

</td>

</tr>

<tr bgColor=""><td colspan="3">&nbsp;</td></tr>

</table>

</center>

</body>

</html>

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...