Sto cercando di ottenere un risultato come quello nell'immagine che ho allegato:
ho costrutito tutto il codice html e ora mi sto cimentando nella parte di "dinamicizzazione"![]()
Ho voluto fare due query distinte in questo modo:
codice:<table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="#F9F9F8"> <td bgcolor="#ACAEB2"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td bgcolor="#F9F9F8" valign="top"> <%rs_news1_sql = "SELECT TOP 2 APPUNTAMENTO_ID, APPUNTAMENTO_TITOLO, APPUNTAMENTO_TESTO, APPUNTAMENTO_FILE FROM APPUNTAMENTI ORDER BY APPUNTAMENTO_DATA DESC" set rs_news1 = oConn.Execute(rs_news1_sql) %> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1"> <% do while not rs_news1.EOF testo = rs_news1("APPUNTAMENTO_TESTO") id = rs_news1("APPUNTAMENTO_ID") %> <tr><td colspan="2" class="arancioneBold"><%=rs_news1("APPUNTAMENTO_TITOLO")%></td></tr> <tr> <td width="25%" valign="top">[img]<%=path_appuntamenti & rs_news1([/img]"></td> <td width="75%" class="news" valign="top"><%=limitaCaratteri(testo, 60)%></td> </tr> <tr><td colspan="2">[img]images/space.gif[/img]</td></tr> <% rs_news1.MoveNext() loop rs_news1.Close%> </table> </td> </tr> </table> </td> <td width="8">[img]images/space.gif[/img]</td> <td bgcolor="#ACAEB2"> <table width="100%" border="0" cellspacing="1" cellpadding="3"> <tr> <td bgcolor="#F9F9F8" valign="top"> <%rs_news1_sql = "SELECT TOP 2 APPUNTAMENTO_ID, APPUNTAMENTO_TITOLO, APPUNTAMENTO_TESTO, APPUNTAMENTO_FILE FROM APPUNTAMENTI WHERE APPUNTAMENTO_ID<>" & id & " ORDER BY APPUNTAMENTO_DATA DESC" set rs_news1 = oConn.Execute(rs_news1_sql) %> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1"> <% do while not rs_news1.EOF testo = rs_news1("APPUNTAMENTO_TESTO")%> <tr><td colspan="2" class="arancioneBold"><%=rs_news1("APPUNTAMENTO_TITOLO")%></td></tr> <tr> <td width="25%">[img]<%=path_appuntamenti & rs_news1([/img]"></td> <td width="75%" class="news" valign="top"><%=limitaCaratteri(testo, 60)%></td> </tr> <tr><td colspan="2">[img]images/space.gif[/img]</td></tr> <%rs_news1.MoveNext() loop%> </table> </td> </tr> </table> </td> </tr> </table>
solo che nella seconda query viene preso solo il secondo id e quindi nel primo box vedo le due ultime news mentre nel secondo box vedo l'ultima news (ripetuta quindi) e la terzultima (giusta)
Come devo fare per impostare correttamente la seconda query![]()


Rispondi quotando

