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. Link to comment https://forums.phpfreaks.com/topic/113499-solved-retrieve-comment-on-that-particular-page/ 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. Link to comment https://forums.phpfreaks.com/topic/113499-solved-retrieve-comment-on-that-particular-page/#findComment-583180 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. Link to comment https://forums.phpfreaks.com/topic/113499-solved-retrieve-comment-on-that-particular-page/#findComment-583188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.