Hi all... I'm creating a form to insert into the table "formazioni" the formations of my fantasy soccer league...
I have a list of 24 available players for a given team and the nearby the name of the player I have to put a 3 selections radio buttons to select if the players is going to play in the starting eleven, or if he is a possible subsitute (7 players) or if he can stay home watching soccer on TV...
THE PROBLEM is that I can select only ONE radio button... NOT ONE PER PLAYER!!!!
this is the part of the code regarding this:
<?PHP
$my_color_1='#CCCCCC';
$my_color_2='#F2F2F2';
$i=1;
$db = mysql_connect("localhost", "$dbuser", "") or die("Problem connecting");
mysql_select_db("$dbname",$db)or die("Problem selecting database");
$result = mysql_query("SELECT * FROM $infogirone WHERE id_s = $infosquadra AND (tesserato ='VERO' AND venduto='FALSO' AND info < '0') ORDER BY ruolo DESC",$db);
while($myrow = mysql_fetch_array($result))
{
$id_g = $myrow["id_g"];
$ruolo = $myrow["ruolo"];
$nome = $myrow["nome"];
$acq = $myrow["acq"];
$nome_A = $myrow["nome_A"];
if($i%2==0) {
$trcolor=$my_color_1;
} else {
$trcolor=$my_color_2;
}
$i++;
echo "<TR bordercolor='#3B4B62' bgcolor='$trcolor'>\n";
echo "<TD>\n";
echo "<font color=$color class='giocatori'>$nome</font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font color=$color class='giocatori'>$nome_A</font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font color=$color class='giocatori'>$ruolo</font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font color=$color class='giocatori'><B>$acq</B></font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<input type='radio' name='formazione' value='1' checked> Titolare";
echo "</TD>\n";
echo "<TD>\n";
echo "<input type='radio' name='formazione' value='2'> Panchina";
echo "</TD>\n";
echo "<TD>\n";
echo "<input type='radio' name='formazione' value='3'> Tribuna";
echo "</TD>\n";
}
?>
if you want you can see herešit's not finished... you can't send data yet...)
http://utenti.lycos.it/fantalimbo/forma.php
I think I should use the id_g (the id of each player - unique) as name of the radio but I'm not sure of how to do it...
thanx for your help!!!
Roberto