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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.