Function probleme incompréenssible
Bonjour j'ai l'erreur si présente :
Citation:
Warning: Invalid argument supplied for foreach() in C:\wamp\www\PHP\Acceuil.php on line 27
(ma ligne 27 correspond a la ligne 18 dans le morceau de code si dessous)mais ma page s'affiche bien en fond.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <?php
$user = 'root';
$pass = '';
$bdd = new PDO('mysql:host=localhost; dbname=skillsend', $user, $pass);
$affichage = 'SELECT * from skillsend';
foreach($bdd->query($affichage) as $text){
}
function annonce($text){
echo'<div>
echo "titre : " . $text["titre"]
echo "déscription : " . $text["description"]
echo "propriétaire : " . $text["proprietaire"]
echo "date : " . $text["date"]
<div/>';}
?> |
Merci si possible j'aimerais les explications avec la réponse.