Tout dépend ce que vous cherchez à faire en fait 
Si $tab_resultat['tournoi'] doit être un scalaire :
$tab_resultat['tournoi'] = $d_tournoi['identification'];
Si $tab_resultat['tournoi'] doit être un tableau :
$tab_resultat['tournoi'][] = $d_tournoi['identification'];
Et au cas où, pour associer votre id au tournoi (?) :
1 2 3 4 5 6 7 8 9
| $no_tournoi=$donnees['no_tournoi'];
$no_equipe=$donnees['no_equipe'];
// Afficher les informations du tournoi
$rep_tournoi = mysql_query("SELECT * FROM tournoi where id=$no_tournoi") or die(mysql_error());
$d_tournoi=mysql_fetch_array($rep_tournoi);
array_push($tab_resultat, array('no' => $donnees['id'], 'tournoi' => $d_tournoi['identification'])); |
(avec une jointure ça devrait être réalisable en une seule requête)
array_push émet effectivement une erreur (non fatale) lorsque le tableau (son premier paramètre) n'existe pas.
Partager