ciao a tutti, come da titolo ho ancora problemi con lo script che sto facendo:
in pratica è un mercatino dell'usato che nella hompage ha una specie di vetrina nella quale mi mostra gli ultimi 8 articoli inseriti solo con foto e che scalano alla prima all'ottava in base all'ultimo post inserito!(praticamente è come un guestbook a categorie!) questo è lo script:
il problema è che se inserisco un post nella stessa categoria e senza immagine di uno che cè nella home, quello della home sparisce.codice:set rs = server.CreateObject("ADODB.Recordset") rs.open "SELECT offercat, MAX(id) FROM mercatino GROUP BY offercat ORDER BY 2 DESC ", Conn ' inizio tabella response.Write"<div align='center'><table border='0' cellspacing='0' cellpadding='0'bordercolor='#000000' ><tr>" max=2 do while not rs.EOF sql = "SELECT * FROM mercatino WHERE offercat = '"& rs("offercat") &"' ORDER BY id DESC" set rsCat = conn.execute(sql) if rsCat("immagine")<>"" then x=x+1 'titolo messaggio titolo = rsCat("offercat") '......................... if x<9 then response.Write"<td width='15px'></td><td><table width='100%' border='1px' cellspacing='0' cellpadding='0' bordercolor='#990000'><tr border='0'><td border='0'><a href=offerlistcat.asp?selectcat=" & titolo &"><img height='89' width='158' src=../../dati/public/mercatino/"&rsCat("IMMAGINE")&" border='0'></td> </tr><tr><td bgcolor='#FAD145'><div align='center'><a href=offerlistcat.asp?selectcat=" & titolo &"><font size='2' color='#000000'>" & rsCat("offernome") &"</font></a></div></td></tr></table> </td><td width='10px'></td>" if x=max then max=max+2 response.Write"<tr></tr>" end if end if end if set rsCat = nothing rs.movenext loop response.Write"</tr></table></div>" rs.close() set rs = nothing conn.close set conn = nothing
spero mi abbiate capito! :master: