questo è il codice ke permette di stampare un recordo ed in + stampare una specie di menu dove poi porta al recordo specifico :bubu: nn sò se mi sn spiegato abbastanza....
$query = "SELECT DISTINCT regione FROM centri ORDER BY regione";
$result = mysql_query($query);
$i = 0;
if($result)
{
while($row = mysql_fetch_array($result))
{
$regione = $row['regione'];
?>
<tr>
<td width='515' height="20" class="regione"><? print $regione?></td>
</tr>
<?
}
}
?>
<tr>
<td width='515'>
<hr color="#FF6600" size="1" width="100%">
</td>
</tr>
<tr>
<td>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<?
include ("../adminwebsite/connect.php");
$query = "SELECT * FROM centri ORDER BY regione AND citta ASC";
$result = mysql_query($query);
$i = 0;
$ankora = "";
if($result)
{
while($row = mysql_fetch_array($result))
{
$idcentro = $row['idcentro'];
$regione = $row['regione'];
$citta = $row['citta'];
$ospedale = $row['ospedale'];
$reparto = $row['reparto'];
$telefono = $row['telefono'];
$i++;
if($i == 1){
?>
<tr>
<?
}
?>
<td width="50%">
<table width="100%">
<?
if ($ankora != strtolower($regione)){?><a name="<?=strtolower($regione)?>"></a><? ; $ankora = strtolower($regione); } ?>
<tr>
<td width="50%"><? print $citta ?></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><? print $opedale ?></td>
<td width="50%"></td>
</tr>
<tr>
<td width="50%"><? print $reparto ?></td>
<td width="50%"><? print $telefono ?></td>
</tr>
</table>
</td>
<?
if($i == 2){
$i = 0;
?>
</tr>
<?
}
}
if($i==1){
?>
<td width="50%"></td></tr>
<?
}
}
mysql_free_result($result);
mysql_close();
?>