PHP:
function stampaRosa(){
$color1 = '#DDFFDD';
$color2 = '#DDCAFF';
$color = '#5533dd';
$count=1;
$query = "SELECT giocatori.cognome,giocatori.ruolo FROM giocatori,utente_has_giocatori where utente_has_giocatori.utente_nick='alex' and giocatori.cognome=utente_has_giocatori.giocatori_cognome";
$res = mysql_query($query);
if ($res)
echo "<br><br>GIOCATORI presenti nella ROSA: ".mysql_num_rows($res)."";
if (!$res) {
echo "Errore nella query richiesta.\n";
exit;
}
echo "<table><tr><td bgcolor='$color' width='160'><b>Cognome</b></td><td bgcolor='$color' width='160'><b>Ruolo</b></td></tr>";
while ($row = mysql_fetch_array($res)) {
if($count%2)
$color=$color1;
else
$color=$color2;
echo"<form action='iframe4.php' method='post' enctype='multipart/form-data'>";
printf ("<tr>");
printf ("<td bgcolor='$color'> $count) %s</td><td bgcolor='$color'>%s</td>", $row[0], $row[1]);
$selezione=$row[0];
printf ("<td><input type='hidden' value='$selezione' name='venduto'><input type='submit' value='Vendi !'></td></tr>");
printf ("</tr>");
$count++;
echo "</form>";
}
echo "</table>";
}