I am making a query to my DB and echo the results to screen.
I would like the possibility to have each result linked seperatly using a
<a href> so that once you click on the link, it brings you a page that only displays the result you clicked on.
Here is the query and echo to screen of the results from the database;
Code: Select all
tTbl("Les Annonces Classées", "left");
$q1 = mysql_query("SELECT idx, titre FROM annonce ORDER BY date DESC LIMIT 5");
$n1 = mysql_num_rows($q1);
if($n1 == 0){
echo "<p align="center">Aucune annonce classée inscrite.</p><br>\n";
} else if($n1 > 0){
echo "<p align="center">Voici les dernières annonces classées. Cliquez sur le titre pour y accéder.</p><br>\n";
while ($r1 = mysql_fetch_array($q1)) {
echo "<p class="mm">• <a href="/annonce_view.php" class="mma">";
echo "<span class="mma">".htmlentities($r1ї"titre"]);
echo "</span></a></p><br>\n";
}
}Code: Select all
<?
// Index
creerIndex("SELECT COUNT(*) AS num FROM annonce", $max_annonce);
// Titre
tTbl("Les Annonces Classées - ".navIndex(), "left");
// Annonces
$q1 = mysql_query("SELECT *, DATE_FORMAT(date, '$site_date_jh') AS dateh FROM annonce ORDER BY date DESC LIMIT $commence, $max");
$n1 = mysql_num_rows($q1);
if ($n1 == 0) {
echo "<p align="center">Il n'y a pas d'annonce classée.</p><br>\n";}
while ($r1 = mysql_fetch_array($q1)) {
echo "<p><span class="titre">".htmlentities($r1ї"titre"])."</span><br>\n";
echo "Envoyé par <b><a href="mailto:".htmlentities($r1ї"email"])."" title="Ecrire à l'envoyeur">".htmlentities($r1ї"auteur"])."</a></b> ".htmlentities($r1ї"dateh"])."</p>\n";
echo "<p>".conv($r1ї"texte"])."</p><br>\n";
}
navBarre("");
// Titre
//tTbl("Apposer une annonce!", "left");
//echo "<p>Vous avez des items a vendre, pourquoi pas apposer une annonce!</p>\n\n";
//
echo "<b><p align="center">Pour inscrire une annonce, <a href="/annonce.php">Cliquer ICI</a></p></b><br>\n";
?>Your feedback is greatly appreciated.