- Joined
- Apr 15, 2008
- Messages
- 256
- Reaction score
- 0
Im trying to make the results look like:
Comments(84) where 84 would be how many records there is in the comments table where news_id is 1
Comments(84) where 84 would be how many records there is in the comments table where news_id is 1
PHP:
<a href="index.php?comment=<?php echo($data['ID']) ?>">Comments(
<?php
$counta=mysql_query("SELECT count(comments) FROM comments WHERE news_id='".$data['id']."'") or die(mysql_error());
$query=mysql_query("SELECT count(comments) FROM comments WHERE news_id='".$data['id']."'") or die(mysql_error());
?></a>)