PHP/MYSQL afficher lien hypertext
Delf
-
lewis34 Messages postés 2557 Date d'inscription Statut Membre Dernière intervention -
lewis34 Messages postés 2557 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je souhaiterai afficher des informations sur une page HTML et notamment des liens hypertext.
J'utilise le programme php suivant
<?php
$con = mysql_connect("localhost","root","mysql");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db_myproject", $con);
$result = mysql_query("SELECT Placename, Description, website_link FROM placetovisit");
echo "<table border='1'>
<tr>
<th>Placename</th>
<th>Description</th>
<th>Website_link</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Placename'] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>" . $row['Website_link'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
Mais j'obtiens un resultat partiel, le colonne website_link reste vide.
Merci pour votre aide
Je souhaiterai afficher des informations sur une page HTML et notamment des liens hypertext.
J'utilise le programme php suivant
<?php
$con = mysql_connect("localhost","root","mysql");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db_myproject", $con);
$result = mysql_query("SELECT Placename, Description, website_link FROM placetovisit");
echo "<table border='1'>
<tr>
<th>Placename</th>
<th>Description</th>
<th>Website_link</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Placename'] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>" . $row['Website_link'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
Mais j'obtiens un resultat partiel, le colonne website_link reste vide.
Merci pour votre aide
Configuration: Windows Vista Internet Explorer 7.0
4 réponses
-
-
Merci pour cette info...le programme utilise dans le lien que tu m'as envoye est un peu different mais je vais quand meme le tester.
Maintenant j'aurai aime resoudre ce probleme d'affichage, le programme php semble correct mais l'affichage est incomplet...
Si tu as d'autres suggestions, je suis bien interessee... -
website_link reste vide
hors tu mets $row['Website_link'] avec un W majuscule, il faut que tu mettes pareil que le libellé de ton champ -
bsr si danston champ website_link il y a le lien que tu veut affciher tout met simplement ça dans ton code
echo "<td><a href=" '. $row['website_link'] .' " target="_blank" >lenom du site</a></td>";