Ich möchte eine Funktion von functions.php
in accueil.php
, aber es funktioniert nicht.PHP Funktion funktioniert nicht, wenn ich sie in HTML ausführen möchte
Meinen HTML-Code:
<div class="milieudepage">
<table>
<tr>
<th> Equipe 1 </th>
<th> Equipe 2 </th>
<th> Drapeau 1 </th>
<th> Drapeau 2 </th>
<th> Score 1 </th>
<th> Score 2 </th>
<th> Buvettes </th>
<th> Volontaires </th>
</tr>
<?php
include("functions.php");
AfficheMatch();
?>
</table>
</div>
Siehe meinen PHP-Code in functions.php
:
<?php
include 'connect.php';
function AfficheMatch()
{
echo "coucou";
$req = $bdd->prepare("SELECT * FROM Equipe");
$req->execute();
while($donnees = $req->fetch())
{
echo '<tr><th>'$donnees['pays']'</th><th>'$donnees['drapeau']'</th></tr>';
}
}
?>
Zur Klarstellung, Sie sehen nichts davon, nicht einmal 'Coucou'? – aaronofleonard
versuchen 'Funktionen :: AfficheMatch();' –
Was sehen Sie, wenn Sie die Webseite "Quelle anzeigen"? –