players | Salut, j'ai une erreur à chaque execution de ceci:
Code :
- require("conf.php" );
- //connexion mysql
- $connexion=mysql_connect($sql_serveur,$sql_user,$sql_passwd);
- $db=mysql_select_db($sql_bdd, $connexion);
- //nbgagnant --> nombre de gagnant par poule
- //nbpoule --> nb de poule
- //on backup la table teamcs:
- $sql0="DELETE FROM `teamcstmp` ";
- $req0=mysql_query($sql0);
- $sql="SELECT * from teamcs";
- $req=mysql_query($sql);
- while ($data = mysql_fetch_array($req)){
- $sql1="INSERT INTO teamcstmp values ('','$data[equipe]','$data[player1]','$data[player2]','$data[player3]','$data[player4]')";
- $req1=mysql_query($sql1);
- }
- //on vide la table des teamcs
- $sql0="DELETE FROM `teamcs` ";
- $req0=mysql_query($sql0);
- //on va chercher les gagnants par poule:
- while ($nbpoule!="0" ){
- $sql36="SELECT * from manchecs where poule='$nbpoule' order by pts limit $nbgagant";
- $req36=mysql_query($sql36);
- while ($data = mysql_fetch_array($req36)){
- //on recup les trucs de tmp
- $sql2="SELECT * from teamcs where equipe=$data[equipe]";
- $req2=mysql_query($sql2);
- $data2 = mysql_fetch_array($req2);
- $sql1="INSERT INTO teamcs values ('','$data[equipe]','$data2[player1]','$data2[player2]','$data2[player3]','$data2[player4]')";
- $req1=mysql_query($sql1);
- }
- $nbpoule=$nbpoule-1;
- }
|
l'erreur:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp\www\cosmo\prog\gagnantcs.php on line 33
Merci d'avance. |