Fid3L
Revolutionary
Salut tout le monde, moi je suis en train d apprendre le php pour transformer petit à petit mon site en quelque chose de plus dynamique. J' ai lu quelques tuto et un livre php jsuis donc assez débutant...
Mon problème :
Je boss sur un script php qui reprend les données et stats des joueurs à partir d' une base de données. J' ai reussi a faire apparaitre les champs que je voulais d une base de données en utilisant la fonction fetch (Ca me met toutes les infos ID par ID). C'est très beau et ca marche niquel mais moi je voudrais afficher que les infos des champs de l' ID 1 par exemple puis de l' ID 2 sur une autre page. Je ne veux pas que tout s affiche a la suite l un de l autre mais les séparer!!!!
J' ai essayer plusieurs manip mais sans succès, je sais que la réponse est toute bête mais j' ai du mal...
ps : j ai du relié 2tables entre elle car je reprends les infos de 2tables différentes. 1pour les coordonnées des joueurs et 1pour leurs statistiques.
Quelqu' un pourait il me donner une astuce pour garder un code général et que juste en modifiant l id ou le nom avoir juste les données d'un joueur précis. (Je crois qu il y a un systeme avec les liens (colombus.php?id=1) ou qqchose comme ça mais je ne suis pas arrivé a faire fonctionner ça.
voici le lien de ma page ( http://colombus80.heberge.co.cc/effectifa.php )
voici le code de ma page :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="FC Colombus 80 - Futsal Bruxelles Club" />
<meta name="keywords" content="colombus, fc, futsal, foot, salle, lffs, mini, foot, statistiques" />
<meta name="Subject" content="Club Futsal" />
<title>FC Colombus - Bruxelles Futsal Club</title>
</head>
<body>
<?php
mysql_connect("", "", "");
mysql_query("SET NAMES UTF8");
mysql_select_db("");
$reponse = mysql_query("SELECT * FROM colombus_a, stats WHERE colombus_a.ID_stats = stats.ID ORDER BY numero");
while ($donnees = mysql_fetch_array ($reponse) )
{
?>
<br /
br />
<table width="81%" border="0">
<tr bgcolor="#CCCCCC">
<td colspan="4"
h2
?php echo $donnees['nom']; ?
/h2
/td>
</tr>
<tr>
<td width="6%"
img src="<?php echo $donnees['photo']; ?>" /
/td>
<td width="1%"> </td>
<td width="54%"
table width="294">
<tbody>
<tr>
<th align="left">Nom</th>
<td align="left"
b
?php echo $donnees['nom']; ?
/b
/td>
</tr>
<tr>
<th width="175" align="left">N°</th>
<td width="107" align="left"
?php echo $donnees['numero']; ?
/td>
</tr>
<tr>
<th align="left">Poste</th>
<td align="left"
?php echo $donnees['poste']; ?
/td>
</tr>
<tr>
<th align="left">Fonction</th>
<td align="left"
?php echo $donnees['fonction']; ?
/td>
</tr>
<tr>
<th align="left">Année d' arrivée</th>
<td align="left"
?php echo $donnees['arrive']; ?
/td>
</tr>
</tbody>
</table
/td>
<td width="39%" align="left"
img src="images/logonew2.jpg" width="192" height="144" /
/td>
</tr>
<tr>
<td colspan="3"
h2>Ses statistiques :</h2
/td>
<td> </td>
</tr>
<tr>
<td colspan="3"
br />
<h3>Ligue L.F.F.S 2010-2011</h3>
<br />
<table cellspacing="0" cellpadding="0">
<tr>
<th width="218" align="left">Matchs</th>
<td width="152" align="left"
?php echo $donnees['match_joue']; ?
/td>
</tr>
<tr>
<th align="left">Buts</th>
<td align="left"
?php echo $donnees['but']; ?
/td>
</tr>
<tr>
<th align="left">Moyenne but/match</th>
<td align="left"
?php $moyenne = $donnees['but'] / $donnees['match_joue']; echo round ($moyenne, 2) ; ?
/td>
</tr>
<tr>
<th align="left"> Passes désicives</th>
<td align="left"
?php echo $donnees['passes']; ?
/td>
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_jaune_22.gif" width="8" height="10" /
/th>
<td align="left"
?php echo $donnees['c_jaune']; ?
/td>
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_rouge_22.gif" alt="" width="8" height="10" /
/th>
<td align="left"
?php echo $donnees['c_rouge']; ?
/td>
</tr>
</table
/td>
<td
br /
h3>Coupe L.F.F.S 2010-2011</h3>
<br />
<table cellspacing="0" cellpadding="0">
<tr>
<th width="218" align="left">Matchs</th>
<td width="152"
?php echo $donnees['match_coupe']; ?
/td>
</tr>
<tr>
<th align="left">Buts</th>
<td
?php echo $donnees['but_coupe']; ?
/td>
</tr>
<tr>
<th align="left">Moyenne but/match</th>
<td
?php $moyenne = $donnees['but_coupe'] / $donnees['match_coupe']; echo round ($moyenne, 2) ; ?
/td>
</tr>
<tr>
<th align="left"> Passes désicives </th>
<td
?php echo $donnees['pass_coupe']; ?
/td>
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_jaune_22.gif" width="8" height="10" /
/th>
<td
?php echo $donnees['cartonj_coupe']; ?
/td>
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_rouge_22.gif" width="8" height="10" /
/th>
<td
?php echo $donnees['cartonr_coupe']; ?
/td>
</tr>
</table
/td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="21" colspan="4"> </td>
</tr>
</table>
<p> </p>
<?php
}
mysql_close();
?>
</body>
</html>
Merci d'avance mes amis gamerziens
Mon problème :
Je boss sur un script php qui reprend les données et stats des joueurs à partir d' une base de données. J' ai reussi a faire apparaitre les champs que je voulais d une base de données en utilisant la fonction fetch (Ca me met toutes les infos ID par ID). C'est très beau et ca marche niquel mais moi je voudrais afficher que les infos des champs de l' ID 1 par exemple puis de l' ID 2 sur une autre page. Je ne veux pas que tout s affiche a la suite l un de l autre mais les séparer!!!!
J' ai essayer plusieurs manip mais sans succès, je sais que la réponse est toute bête mais j' ai du mal...
ps : j ai du relié 2tables entre elle car je reprends les infos de 2tables différentes. 1pour les coordonnées des joueurs et 1pour leurs statistiques.
Quelqu' un pourait il me donner une astuce pour garder un code général et que juste en modifiant l id ou le nom avoir juste les données d'un joueur précis. (Je crois qu il y a un systeme avec les liens (colombus.php?id=1) ou qqchose comme ça mais je ne suis pas arrivé a faire fonctionner ça.
voici le lien de ma page ( http://colombus80.heberge.co.cc/effectifa.php )
voici le code de ma page :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="description" content="FC Colombus 80 - Futsal Bruxelles Club" />
<meta name="keywords" content="colombus, fc, futsal, foot, salle, lffs, mini, foot, statistiques" />
<meta name="Subject" content="Club Futsal" />
<title>FC Colombus - Bruxelles Futsal Club</title>
</head>
<body>
<?php
mysql_connect("", "", "");
mysql_query("SET NAMES UTF8");
mysql_select_db("");
$reponse = mysql_query("SELECT * FROM colombus_a, stats WHERE colombus_a.ID_stats = stats.ID ORDER BY numero");
while ($donnees = mysql_fetch_array ($reponse) )
{
?>
<br /
<table width="81%" border="0">
<tr bgcolor="#CCCCCC">
<td colspan="4"
</tr>
<tr>
<td width="6%"
<td width="1%"> </td>
<td width="54%"
<tbody>
<tr>
<th align="left">Nom</th>
<td align="left"
</tr>
<tr>
<th width="175" align="left">N°</th>
<td width="107" align="left"
</tr>
<tr>
<th align="left">Poste</th>
<td align="left"
</tr>
<tr>
<th align="left">Fonction</th>
<td align="left"
</tr>
<tr>
<th align="left">Année d' arrivée</th>
<td align="left"
</tr>
</tbody>
</table
<td width="39%" align="left"
</tr>
<tr>
<td colspan="3"
<td> </td>
</tr>
<tr>
<td colspan="3"
<h3>Ligue L.F.F.S 2010-2011</h3>
<br />
<table cellspacing="0" cellpadding="0">
<tr>
<th width="218" align="left">Matchs</th>
<td width="152" align="left"
</tr>
<tr>
<th align="left">Buts</th>
<td align="left"
</tr>
<tr>
<th align="left">Moyenne but/match</th>
<td align="left"
</tr>
<tr>
<th align="left"> Passes désicives</th>
<td align="left"
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_jaune_22.gif" width="8" height="10" /
<td align="left"
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_rouge_22.gif" alt="" width="8" height="10" /
<td align="left"
</tr>
</table
<td
<br />
<table cellspacing="0" cellpadding="0">
<tr>
<th width="218" align="left">Matchs</th>
<td width="152"
</tr>
<tr>
<th align="left">Buts</th>
<td
</tr>
<tr>
<th align="left">Moyenne but/match</th>
<td
</tr>
<tr>
<th align="left"> Passes désicives </th>
<td
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_jaune_22.gif" width="8" height="10" /
<td
</tr>
<tr>
<th align="left">Cartons <img src="images/carton_rouge_22.gif" width="8" height="10" /
<td
</tr>
</table
</tr>
<tr bgcolor="#FFFFFF">
<td height="21" colspan="4"> </td>
</tr>
</table>
<p> </p>
<?php
}
mysql_close();
?>
</body>
</html>
Merci d'avance mes amis gamerziens