Trouble Retrieving a count from a MySQL db
Posted: Sun Jan 02, 2005 6:21 am
Just trying to retrieve a count from the database I'm linked to with regards to comments made on a news article. It so far displays a "view comments" link if there are any comments on that article in question but I'm trying to include the number of comments in that link too. For example; view comments[5]
this is the code I have so far:
Can anyone point out what else i need or where I might have gone wrong in trying to perform this?
Thanks
feyd | Help us, help you. Please use
this is the code I have so far:
Code: Select all
// if there are then display the "view comments" link.
if (!mysql_num_rows($comments) == 0)
{
// The javascript allows the "view comments" to be toggled on and off by clicking the link
$comment_result = mysql_query ($comments);
$comment_row = mysql_fetch_row($comment_result);
?>
| <a href="#" onclick="toggle('viewcomment<?=$row['entryID']?>')">View comments<?=['$comment_row']?>"</a>
<div id="viewcomment<?=$row['entryID']?>" style="display: none;">Thanks
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]