Jump to content

[SOLVED] counting with sql


dennismonsewicz

Recommended Posts

I have wrote my own backend to my personal website and am looking to see how to count how many posts are in a particular section (or subject).

 

Code:

$query = mysql_query("SELECT * FROM sections")or die(mysql_error());

	while($row = mysql_fetch_object($query)) {

		echo '<p>';
		echo '<a href="cat.php?action=view&catid=' . $row->section_id . '" class="blogpost"><img src="images/arrow.gif" alt="arrow"/>' . ucwords($row->sections) . '</a>';
		echo '</p>';
}

Link to comment
https://forums.phpfreaks.com/topic/152254-solved-counting-with-sql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.