J'ai encore un problème, alors voici mon code :
index.php
Code : Tout sélectionner
include("views/vueNavigation.php");
include("views/vueMenu.php");
include("pages/getBillet.php");
$table = getBillet();
var_dump($table);
include("views/vueBillet.php");
Code : Tout sélectionner
<?php
function getBillet()
{
$ressource = mysql_query("SELECT idbillets, title, content FROM billets");
$result= array();
while($row=mysql_fetch_assoc($ressource))
{
$result[]=$row;
}
return $result;
}
?>
Code : Tout sélectionner
<html>
<head>
</head>
<body>
<div id="body">
<?php
foreach ($table AS $row)
{
echo '<div id="titleBillet">';
echo $table[title];
echo '</div>';
echo '<div id="contentBillet">';
echo $table[content];
echo '</div>';
}
?>
</div>
</body>
</html>Mais j'ai un problème avec mon code qui est situé dans vueBillet.php j'ai cette erreur là :
Notice: Undefined index: title in C:\wamp\www\blogblogblog\views\vueBillet.php on line 11
Notice: Undefined index: content in C:\wamp\www\blogblogblog\views\vueBillet.php on line 15
Le message d'erreur est clair, mais je ne comprend pas pourquoi.
Cordialement,