Questo è il codice della pagina:
Codice PHP:
<?PHP
session_start();
include "config.inc.php";
$query = "SELECT * FROM FIGULOT GROUP BY NICKNAME";
$result = mysql_query($query, $connessione) or die(mysql_error());
$TOTALE_UTENTI = mysql_num_rows($result);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="stile2.css" type="text/css">
<title>FiguLot</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-language" content="it">
</head>
<body>
<form name="playlist" action="index.php" method="GET">
<div align="center">
<?include('bannerino.php')?>
<script language="javascript" type="text/javascript">
document.write('<s'+'cript language="javascript" src="http://ad.altervista.org/alternet.ad?c=1&f=0&'+new Date().getTime()+'"><\/s'+'cript>');
</script>
<BR><a href="regolamento.php" target="_blank" class="header">Il regolamento</a>
<A HREF='http://62.149.194.19/asp/lotring.asp' target='_blank'><IMG SRC='http://62.149.194.19/img/logo/dlotring.jpg' border='0' width='160' height='50' alt='DreamALOT-ring'></A> <!-- Inizio Codice Shinystat -->
<script type="text/javascript" language="JavaScript" SRC="http://codice.shinystat.com/cgi-bin/getcod.cgi?USER=figulot"></script>
<noscript>
<A HREF="http://www.shinystat.com" target="_top">
<IMG SRC="http://www.shinystat.com/cgi-bin/shinystat.cgi?USER=figulot" ALT="Hit counters" BORDER="0"></A>
</noscript>
<!-- Fine Codice Shinystat --><br><br>
<font class="header">Per avere una figulot invia una email a <b>figulot@email.it</b></font><br>
<table width=600 border=0 cellspacing=2 cellpadding=0>
<tr><td class="header2" colspan=4>Sono state inserite <b><?=$TOTALE_UTENTI?></b> figulot.</td></tr>
</tr></table>
<table width=600 border=0 cellspacing=2 cellpadding=0>
<tr>
<td class="header"><a href="index.php?nome=A%&ordina=NICKNAME&per=ASC&limit=999">A</a></td>
<td class="header"><a href="index.php?nome=B%&ordina=NICKNAME&per=ASC&limit=999">B</a></td>
<td class="header"><a href="index.php?nome=C%&ordina=NICKNAME&per=ASC&limit=999">C</a></td>
<td class="header"><a href="index.php?nome=D%&ordina=NICKNAME&per=ASC&limit=999">D</a></td>
<td class="header"><a href="index.php?nome=E%&ordina=NICKNAME&per=ASC&limit=999">E</a></td>
<td class="header"><a href="index.php?nome=F%&ordina=NICKNAME&per=ASC&limit=999">F</a></td>
<td class="header"><a href="index.php?nome=G%&ordina=NICKNAME&per=ASC&limit=999">G</a></td>
<td class="header"><a href="index.php?nome=H%&ordina=NICKNAME&per=ASC&limit=999">H</a></td>
<td class="header"><a href="index.php?nome=I%&ordina=NICKNAME&per=ASC&limit=999">I</a></td>
<td class="header"><a href="index.php?nome=J%&ordina=NICKNAME&per=ASC&limit=999">J</a></td>
<td class="header"><a href="index.php?nome=K%&ordina=NICKNAME&per=ASC&limit=999">K</a></td>
<td class="header"><a href="index.php?nome=L%&ordina=NICKNAME&per=ASC&limit=999">L</a></td>
<td class="header"><a href="index.php?nome=M%&ordina=NICKNAME&per=ASC&limit=999">M</a></td>
<td class="header"><a href="index.php?nome=N%&ordina=NICKNAME&per=ASC&limit=999">N</a></td>
<td class="header"><a href="index.php?nome=O%&ordina=NICKNAME&per=ASC&limit=999">O</a></td>
<td class="header"><a href="index.php?nome=P%&ordina=NICKNAME&per=ASC&limit=999">P</a></td>
<td class="header"><a href="index.php?nome=Q%&ordina=NICKNAME&per=ASC&limit=999">Q</a></td>
<td class="header"><a href="index.php?nome=R%&ordina=NICKNAME&per=ASC&limit=999">R</a></td>
<td class="header"><a href="index.php?nome=S%&ordina=NICKNAME&per=ASC&limit=999">S</a></td>
<td class="header"><a href="index.php?nome=T%&ordina=NICKNAME&per=ASC&limit=999">T</a></td>
<td class="header"><a href="index.php?nome=U%&ordina=NICKNAME&per=ASC&limit=999">U</a></td>
<td class="header"><a href="index.php?nome=V%&ordina=NICKNAME&per=ASC&limit=999">V</a></td>
<td class="header"><a href="index.php?nome=W%&ordina=NICKNAME&per=ASC&limit=999">W</a></td>
<td class="header"><a href="index.php?nome=X%&ordina=NICKNAME&per=ASC&limit=999">X</a></td>
<td class="header"><a href="index.php?nome=Y%&ordina=NICKNAME&per=ASC&limit=999">Y</a></td>
<td class="header"><a href="index.php?nome=Z%&ordina=NICKNAME&per=ASC&limit=999">Z</a></td>
<td class="header"><a href="index.php">Ultime</a></td>
</tr>
</table>
<table><tr>
<font color=EBEBEB size=1>
<?PHP
if( !isset($_GET['ordina']) )
{
$_GET['ordina'] = 'ID';//setta quello di default
}
if( !isset($_GET['per']) )
{
$_GET['per'] = 'DESC';//setta quello di default
}
if( !isset($_GET['genere']) )
{
$_GET['genere'] = '%';//setta quello di default
}
if( !isset($_GET['limit']) )
{
$_GET['limit'] = '20';//setta quello di default
}
if( !isset($_GET['nome']) )
{
$_GET['nome'] = '%';//setta quello di default
}
$sqlonline = "SELECT ID, NICKNAME, FOTO, GENERE, CONFERMA FROM FIGULOT
WHERE ID LIKE '%' AND NICKNAME LIKE '{$_GET['nome']}' AND GENERE LIKE '{$_GET['genere']}' AND CONFERMA LIKE 'SI' ORDER BY {$_GET['ordina']} {$_GET['per']} LIMIT {$_GET['limit']}";
$conteggio = mysql_query($sqlonline,$connessione) or die(mysql_error());
if (mysql_num_rows ($conteggio) < 1)
{
echo('Nessun risultato');
}
$CONTA = 0;
while($ROW3 = mysql_fetch_array($conteggio))
{
$ON_ID=$ROW3["ID"];
$ON_NICKNAME=$ROW3["NICKNAME"];
$ON_FOTO=$ROW3["FOTO"];
$ON_GENERE=$ROW3["GENERE"];
$ON_CONFERMA=$ROW3["CONFERMA"];
?>
</font>
<td>
<table width="215" height="257" background="avatar_ritratto.gif">
<tr height="20"><td> </td></tr>
<tr height="200"><td align="center"><img src="../img/<?=$ON_FOTO?>" width="190" height="180"><br>
<font class="nome"><b><?=$ON_NICKNAME?></b></font></td></tr>
</table>
</td>
<?
}
@mysql_close ($connessione);
?></tr>
</table>
</div>
</div>
<br><br><br><br>
<div align="center">
<script language="javascript" type="text/javascript">
document.write('<s'+'cript language="javascript" src="http://ad.altervista.org/alternet.ad?c=5&f=0&'+new Date().getTime()+'"><\/s'+'cript>');
</script>
</div>
</div>
</div>
</body>
</html>
Il mio problema è nello "stampo" della query, ovvero messa cosi continua a mettermi tutti i risultati in "orizzontale", continuando con i <td> </td> etc.. all' infinito, senza badare alla grandezza dello schermo. Se aggiungo un </tr> prima della chiusura della query, ovviamente, mi sbarella facendoli invece tutti in verticale, 1, 1, 1, etc...
Qualcuno ha idee da consigliare per far si che dopo 4 risultati la tabella faccia un </tr> </tr> e riparta dalla riga sotto, mettendo quindi tutti i risultati divisi in file da 4? Grazie :-)