Erreur mysql

kpan dro -  
JooS Messages postés 2705 Statut Membre -
Bonjour,

j travaille avec PHP/MySQL ,
Je veux afficher les donnees d'une de mes table sur une page et voici
l erreur qui s affiche .

<<Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /home/forumpro/public_html/mes.php on line 42>>

Et pourtant en local ca fonctionne bien . merci de m aider

voici le code

<?php
if (!empty($_POST))
{
// Ajout de postes
if (isset($_POST['Afficher']))
{
//Ouverture d'une session

$DDEBUT=$_POST['DU'];
$DFIN=$_POST['AU'];

// Controle des champs vides
if ($DDEBUT=="" OR $DFIN=="")
{
echo("Merci de saisir la période début et fin");
}

$sql="SELECT * FROM messages WHERE datemes>=$DDEBUT AND datemes<=$DFIN ORDER BY idmes DESC";
$resultat=mysqli_query($link,$sql);
while ($ligne=mysqli_fetch_array($resultat))
{

?>
<strong> <?php echo 'Nom :'?></strong> <br/><?php echo $ligne["nommes"];?><br/>
<strong><?php echo 'email :'?> </strong><br/><?php echo $ligne["emailmes"];?><br/>
<strong> <?php echo 'Contacts :'?></strong> <br/><?php echo $ligne["telmes"];?><br/>
<strong> <?php echo 'Message :'?></strong><br/><?php echo $ligne["messagemes"];?><br/>
<strong><?php echo 'Date :'?></strong><br/><?php echo $ligne["datemes"];?><br/>
<strong> <?php echo 'Heure :'?></strong><br/><?php echo $ligne["heuremes"];?><br/>
<hr><br/>
<?php

}


}


}

?>
<!-- Créer une connxion-->

<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">

<!-- Créer une postes-->
<legend>Entrez une Période</legend>
<TABLE WIDTH=0 BORDER=0 align="center" CELLPADDING=0 CELLSPACING=0>

<tr>
<td COLSPAN=1><label for="DU">
<div align="left">Période Du</div>
</label>

<input type="date" style="border:solid 1px #999999; text-transform:uppercase;height:30px; text-transform:uppercase; text-align:center;"
name="DU" id="DU" size="30" value="<?php echo @$DDEBUT;?>"/></td>

<td COLSPAN=0><label for="AU">
<div align="left">Au</div>
</label>

<input type="date" style="border:solid 1px #999999; text-transform:uppercase; height:30px; text-transform:uppercase; text-align:center;" name="AU" id="AU" size="30" value="<?php echo @$DFIN?>"/></td>
</tr>
</table>

<div align="center"> <input name="Afficher" type="submit" style=" width:400px; text-align:center; height:30px;" value="Afficher"/></div>

</div>

</div>
</form>

1 réponse

JooS Messages postés 2705 Statut Membre 228
 
Salut,

Ta base de données (table concerné) distante est peut être vide !

Mettez en résolu quand c'est résolu -.- ...
0