Jump to content

[SOLVED] Counting a field


Nexy

Recommended Posts

Why Hello There!  :) Just an idea I had, need some help on how to do it. The following is a layout:

 

Let's say I have a row named newsid. How would I make a query where it selects newsid with the value of a certain a number(the number comes from another table.). Then display a number saying you have "9" fields that match newsid with the number.

 

The 9 is just an example. Did I make sense? Any help would be appreciated.

 

Thank You!  :)

Link to comment
Share on other sites

Sorry, I meant to say column. And I think you misunderstood me.

 

Maybe this will help:

 

| id | newsid | content |

------------------------

| 1 |    3    |  Test1  |

| 2 |    3    |  Test2  |

| 3 |    3    |  Test3  |

------------------------

 

I just want it to echo "You have 3 rows where newsid = 3". It could be more or less. Thank You!

 

 

EDIT: Actually, nevermind, I misread your post. Thank You it worked.

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.