How can i count with php all comments in one album ?
Please explain what you are trying to accomplish.
on my main website i give the last 3 albums out
<?php
$query = "SELECT * FROM party31gallery_albums ORDER BY aid DESC LIMIT 3";
$result=mysql_query($query);
while ($daten=mysql_fetch_array($result, MYSQL_ASSOC))
{
$datum = substr($daten[title], -10);
$title = substr($daten[title], 0, -10);
echo "<tr>";
echo "<td width=15% class=row2>$datum</td>";
echo "<td width=45% class=row2><a href=http://party31.web.my-ct.de/party31/gallery/thumbnails.php?album=$daten[aid]><font color=#000000 size=2>$title</a></td>";
echo "<td width=15% class=row2> </td>";
echo "</tr>";
}
?>
and now i want to give the number of all comments in one album out.
But i dont know what the MySql command is ?
The statement would be
SELECT COUNT(msg_id) FROM party31gallery_comments AS c INNER JOIN party31gallery_pictures AS p ON p.pid = c.pid WHERE p.aid = n
n = the aid of the album in question.
and the whole code with output ?
i dont know how i can give out only the number of all comments...
$result = mysql_query("SELECT COUNT(msg_id) FROM party31gallery_comments AS c INNER JOIN party31gallery_pictures AS p ON p.pid = c.pid WHERE p.aid = n");
list($numcom) = mysql_fetch_row($result);
echo "There are $numcom comments in this here album mister";
and can i make a graphik which appears when the last comment was 15 minutes ago post. ?
How ?
mhm.. if not .. can i give out the date of the last comment ?
THANK YOU VERY MUCH YOU ARE MY HERO FOR TODAY :):):)