Voila j'ai besoin pour ma page de mettre du texte dans un tableau.Jusque la tout va mais si le texte est trop long pour que je l'affiche en accueil je désire faire un lien vers la page de la new.
Seulement je ne parviens pas a faire en sorte que le lien ne s'affiche que si la variable de ma BDD contient du texte.
Si la variable est vide je ne veut pas voir le lien.
Citation :
<?php
mysql_connect("localhost", "...", "..."); // Connexion à MySQL
mysql_select_db("acceuil"); // Sélection de la bdd news
$reponse = mysql_query("SELECT * FROM acceuil ORDER BY id DESC"); // Requête SQL
// On fait une boucle pour lister tout ce que contient la table :
while ($donnees = mysql_fetch_array($reponse) )
{
?>
<table style="width: 85%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2" cellspacing="0">
<tbody>
<tr>
<td style="width: 987px; text-align: center;" background="images/index_24.gif"><span style="font-family: Comic Sans MS; color: rgb(0, 0, 0);">
<?php echo $donnees['date']; ?></span></td>
</tr>
<tr>
<td style="width: 987px; text-align: center; background-color: rgb(102, 102, 102); color: rgb(255, 255, 255);"><big><big style="text-decoration: underline;"><span style="font-family: Diploma;"><?php echo $donnees['titre']; ?></span></span></big></big><br style="font-family: Times New Roman;">
<br style="font-family: Comic Sans MS;">
<span style="font-family: Comic Sans MS;"><?php echo $donnees['contenu']; ?><br>
</span>
--------------------------------------------------------
//c'est ici que je bloque
if(empty('$donnees['lien']'))
{
echo '';
}
else
{
echo '<div style="text-align: right;"><a href= <?php echo $donnees['lien']; ?> /><span style="font-family: Zrnic; color: rgb(153, 0, 0);">Lire la
suite</span></a></div>';
}
--------------------------------------------------------
</td>
</tr>
<tr>
<td style="width: 987px;" background="images/index_24.gif"></td>
</tr>
</tbody>
</table>
<?php
}
mysql_close(); // Déconnexion de MySQL
?>