Jump to content

Count Total Records.


phpSensei

Recommended Posts

I have a forum and its is almost finished...

 

I am currently displaying the Total number of Topics within a Forum, but I dont know how.

 

Each Topic is assigned to a Forum by inserting the Forum's id which is "ID", (located in forums table), and into a field named idforum, which is located in the topic_fr table.

 

Now that idforum has the id of the forum it has been inserted into, I can display these in each forum.

 

I have 2 forums, but I do not know how to display the total number of topics in each forum.

 

I was thinking something like this, but no.

 

$query = mysql_query("SELECT * FROM message_msg INNER JOIN forums ON idtop_msg=id WHERE idtop_msg='$id'"); 
$number=mysql_num_rows($query); 
echo $number; 

 

 

Link to comment
https://forums.phpfreaks.com/topic/59554-count-total-records/
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.