1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
$hid = $_POST['hid'];
$search = mysql_query("SELECT news.id,news.nom,news.titre,news.spec,news.photoarticle,news.date,count( * ) AS nombre FROM news JOIN commentaire WHERE news.id = commentaire.sid AND news.hid='$hid' GROUP BY news.id ORDER BY news.date DESC LIMIT 0, 100") or die ("ERROR:" . mysql_error());
$num = mysql_num_rows($search);
$nombre = $row['nombre'];
if ($num == 0) {
echo "Il y a <b>$num</b> article(s) associées à la catégorie : </b>";
echo "Pas d'article!";
} else {
echo "Il y a <b>$num</b> news associées à la catégorie";
while ($row = mysql_fetch_array($search)) {
echo "$row[0]";
} |