Salve a tutti ho questo codice:
Codice PHP:
<html> <head> <!-- cambia stile con altro<link rel="stylesheet" type="text/css" href="stile.css">--><a class="yellow" href="../index.html"><div style="text-align:left;font-weight:bold;color:red;font-size:25px">Home</a></div> <script type="text/javascript" src="/table/jquery.js"></script> <script type="text/javascript" src="/table/jquery.tablesorter.js"></script> <script type="text/javascript">$(document).ready(function(){ $("#tabella").tablesorter(); });</script></head><?phperror_reporting(0); ini_set("display_errors", 0); ini_set("display_startup_errors", 0); ini_set("track_errors", 0); ini_set("log_errors", 0); $con=mysqli_connect("localhost","","","portoarmi");if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $cognome=addslashes($_REQUEST['cognome']);$nome=addslashes($_REQUEST['nome']);$luogo=addslashes($_REQUEST['data_nasc']);$query=mysqli_query($con,"select * from tracking order by id desc ");
$risultato=($query);$numero=mysqli_num_rows($risultato);echo "<center> Utenti registrati numero:<strong>".$numero."</strong></center>"; $contenuto="<table id='tabella' class='tablesorter' cellpadding=2 align = center width=100% border=2><p><thead> <tr> <th align = center>ID</th> <th align = center>Cognome</th> <th align = center>Nome</th> <th align = center>Data di Nascita</th> <th align = center>Codice</th> <th align = center>Stato pratica attuale</th> <th align = center>Stato pratica</th> </tr> <thead>"; //ciclo di caricamento delle righe
while ($riga = mysqli_fetch_assoc($risultato)) {$id=$riga['id'];$contenuto .= "<tr><td align = center><b>".$riga["id"]."</b></td>";$contenuto .= "<td align = center><b>".$riga["cognome"]."</b></td>";$contenuto .= "<td align = center>".$riga["nome"]."</td>";$contenuto .= "<td align = center>".$riga["data_nascita"]."</td>";$contenuto .= "<td align = center>".$riga["codice"]."</td>";$contenuto .= "<td align = center>".$riga["tracking"]."</td>";$contenuto .="<td align = center><img src='logo.png' width=76 height=68 border=0 usemap=#map />
<map name=map><area shape=rect coords=16,5,37,27 href='rosso.php?id=$id' /><area shape=rect coords=44,10,66,37 href='verde.php?id=$id' /><area shape=rect coords=9,33,30,55 href='blu.php?id=$id' /><area shape=rect coords=36,37,57,63 href='giallo.php?id=$id' /></map></td>";
}
$contenuto .= "</table></p>";
echo $contenuto; mysqli_close($con);?>
Nella tabella mappa mi ristituisce solo l'ultimo id a tutte le righe.