Hi all...first of all I'm not sure that the title is really explaining what I'm trying to do as I'm not sure of my technical english....
I have a page http://web.frontera.be/fantalimbo/invia_formazione.php
where the managers of fantasy teams will be able to send the weekly formations to the DB (we are speaking about Italian Serie A soccer fantasy league)
What I would like to do is to populate the players name options with data coming from mysql DB.....
I found a tutorial at DEVSHED but I need to apply it to my page....
I don't know what to post so.....
this is the code found in the tutorial where I added the correct SELECT:
<?PHP
$db = mysql_connect("**a.be", "fabo", "pwd") or die("Problem connecting");
mysql_select_db("fa***bo",$db)or die("Problem selecting database");
$result = mysql_query("SELECT ruolo, nome
FROM phpSP_users, giocatori, giocatori_squadre
WHERE phpSP_users.user_id=1 (the "1" will be $ID with the logged person ID...)
AND phpSP_users.user_id=giocatori_squadre.user_id AND giocatori_squadre.id_giocatore=giocatori.id_giocatore ORDER BY ruolo DESC",$db);
$type = "";
$number2 = "0";
while ($myrow = mysql_fetch_row($result)) {
if ($myrow[2] != $type) {
if ($number2 != NULL) {
$newnumber2 = ($number2 + "1");
print ("ar[$number2] = new Array();\n");
$number2 = $newnumber2;
$type = $myrow[2];
$number = "0";
}
}
print "ar[" . ($number2 - "1") . "]";
if ($number != NULL) {
$newnumber = ($number + "1");
print ("[$number]");
$number = $newnumber;
}
print (" = new makeOption(\"$myrow[1]\", \"$myrow[2]\");\n");
}
?>
you can check the result of this code here....
http://web.frontera.be/fantalimbo/invia_formazione2.php
I understand I'm pointing over the right way but I don't know how to correct this code in order to fill the variables of the select with the correct data.....
I hope I have been clear enough.....
Thanx for all the inputs I'll receive....
Roberto