corillo181 Posted May 28, 2006 Share Posted May 28, 2006 so i'm trying to count the rows in a table .. the situation is as fallow.. someone leaves a comment about something.. the id goes in to the comment table.. now i want to count how many times ppl left comment about that one thing.. this is what i tried but it dont work..[code=php:0]$rows=mysql_query("SELECT comment_id FROM pcomment WHERE photo_id='pic_id' ");$countrow=mysql_num_rows($rows);echo $countrow;[/code] Link to comment https://forums.phpfreaks.com/topic/10666-help-out-a-little-here/ Share on other sites More sharing options...
appeland Posted May 28, 2006 Share Posted May 28, 2006 Hi,this should do:SELECT count(comment_id) FROM pcomment WHERE photo_id='pic_id'Full explanation at [a href=\"http://dev.mysql.com/doc/refman/5.0/en/counting-rows.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/counting-rows.html[/a]Regards,Andi Link to comment https://forums.phpfreaks.com/topic/10666-help-out-a-little-here/#findComment-39801 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.