unsider Posted July 7, 2008 Share Posted July 7, 2008 Let's assume I'd like to grab the # of the comment on that specific comment. I'm using one DB table to store all the comments on every article, therefore, just retrieving the 'id' is not sufficient. I think I have an idea, but I'm not sure how I'd write the syntax for it. I'd retrieve the # of comments for that particular article, but then I need to display the # in which they are being displayed on that particular page... Maybe you guys can help me work out the logic, I just can't wrap my head around it. Thanks. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 7, 2008 Share Posted July 7, 2008 To get the number of comments, you'd use the COUNT function in MySQL. Then, you can just use a counter inside the while loop to increment it as you go through the comments. Quote Link to comment Share on other sites More sharing options...
unsider Posted July 7, 2008 Author Share Posted July 7, 2008 Cool, I'll go look that up right away. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.