Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php
/*
  +---------------------------------------------------------------------+
  | phpTournois                                                         |
  | phpTournoisG4 ©2005 by Gectou4 <Gectou4 Gectou4@hotmail.com>        |
  +---------------------------------------------------------------------+
  | Copyright© 2001-2004 Li0n, RV, Gougou (http://www.phptournois.net)  |
  +---------------------------------------------------------------------+
  | Ce fichier sert un faire un classement général sur les tournois de  |
  | foot (ex:PES5). Il ne fonctionne pas pour les autre jeux            |
  |                                                                     |
  | phpTournois is free software; you can redistribute it and/or modify |
  | it under the terms of the GNU General Public License as published by|
  | the Free Software Foundation; either version 2 of the License, or   |
  | (at your option) any later version.                                 |
  |                                                                     |
  | phpTournois is distributed in the hope that it will be useful,      |
  | but WITHOUT ANY WARRANTY; without even the implied warranty of      |
  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       |
  | GNU General Public License for more details.                        |
  |                                                                     |
  | You should have received a copy of the GNU General Public License   |
  | along with AdminBot; if not, write to the Free Software Foundation, |
  | Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA       |
  |                                                                     |
  +---------------------------------------------------------------------+
  | Copyright© 2006 Minichap (http://www.arcadie42.com)                 |
  |                                                                     |
  | Auteur: Maxime BLUZAT  <minichap@aol.com>                           |
  |                        <maximebluzat@hotmail.com>                   |
  +---------------------------------------------------------------------+
*/
 
if (preg_match("/classement.php/i", $_SERVER['PHP_SELF']))
{
    die ("You cannot open this page directly");
}
$requete = mysql_query( "SELECT id,FROM phpt_joueurs WHERE id = $s_joueur" ) or die( 'could not connect to db' );
 
    while( $result = mysql_fetch_array( $requete ) )
{
$sortie = $result['carton'];
}
 
 
if ($sortie <>"vert" ) js_goto("?page=index");
 
echo "<p class=title>.:: $strClassement ::.</p>";
 
 
// Points
define('PTSVICTOIRE',5);
define('PTSNUL',2);
define('PTSDEFAITE',-2);
define('SCOREVICTOIREFORFAIT',5);
define('SCOREDEFAITEFORFAIT',-5);
define('SCOREVICTOIREDISCA',5);
define('SCOREDEFAITEDISCA',-5);
define('PTSVICTOIRECOUPE',30);
define('PTSVICTOIRETOURNOI',30);
 
// Champs récupéré dans la requete
$champs = "J.pseudo as pseudo_J,J2.pseudo as pseudo_J2,M.statusequipe as statusequipe_M,M2.score1 as score1_M2,M2.score2 as score2_M2,T.type as type_T,M.finale as finale_M";
 
// Requéte
$Requete1 = "(SELECT ".$champs."
                FROM phpt_manches M2
                INNER JOIN phpt_matchs M
                ON M2.matchi=M.id
                INNER JOIN phpt_tournois T
                ON T.id=M.tournois
                INNER JOIN phpt_equipes E
                ON E.id=M.equipe1
                INNER JOIN phpt_joueurs J
                ON J.id=E.manager
                INNER JOIN phpt_equipes E2
                ON E2.id=M.equipe2
                INNER JOIN phpt_joueurs J2
                ON J2.id=E2.manager
                WHERE T.modeequipe='E'
                AND M.status='T'
                ORDER BY T.id,M.id ASC)";
$Requete1 .= "UNION";
$Requete1 .= "(SELECT ".$champs."
                FROM phpt_manches M2
                INNER JOIN phpt_matchs M
                ON M2.matchi=M.id
                INNER JOIN phpt_tournois T
                ON T.id=M.tournois
                INNER JOIN phpt_joueurs J
                ON J.id=M.equipe1
                INNER JOIN phpt_joueurs J2
                ON J2.id=M.equipe2
                WHERE T.modeequipe='J'
                AND M.status='T'
                ORDER BY T.id,M.id ASC)";
 
// Déclaration des champs du tableau de classement
$tabChamp = array("place","joueur","matchJ","matchG","matchN","matchP","butP","butC","butE","tournoi","coupe","points");
// Déclaration des entetes du tableau
$table_name = array("Place",
                    "Joueur",
                    "<acronym class=\"acronymTournois\" title=\"Total de match(s) joué(s)\">Nb</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Match(s) Gagné(s)\">G</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Match(s) Nul(s)\">N</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Match(s) Perdu(s)\">P</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"But(s) Pour\">BP</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"But(s) Contre\">BC</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Goal Average\">GA</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Tournoi(s) Remporté(s)\">T</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Coupe(s) Remporté(s)\">C</acronym>",
                    "<acronym class=\"acronymTournois\" title=\"Points\">Pts</acronym>");
 
 
// On fait la requete
$ResultatRequete1 = mysql_query($Requete1)
    or die(mysql_error());
 
$tab = rec_classement($tabPseudo,$tabChamp,$ResultatRequete1);
 
if ($tab != NULL)
{
    $tab = tri_classement($tab,$tabPseudo,$tabChamp);
 
    affiche_classement($tab,$tabPseudo,$tabChamp,$table_name);
}
 
?>
J'ai cette erreur qui s'affiche:
Warning: mysql_query(): A link to the server could not be established in /var/www/sdb/f/1/include/files/classement.php on line 38
Je me doute que ce code est dégueulasse au niveau de la connexion mais je ne vois pas ce que je peux faire.