Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 409523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:47:56+00:00 2026-05-12T17:47:56+00:00

I got some help with gettin the number of rows returned from mysql, and

  • 0

I got some help with gettin the number of rows returned from mysql, and it works fine…
BUT, how do I get the number of rows with a certain field value?
Do I have to make a new Mysql search query?

Here is the code where I query mysql and display in a table using fetch_array… Also, Im using mysql_num_rows to get number of rows.
So how do I get number of rows with certain field value also?

$qry_result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_num_rows($qry_result);
while($row = mysql_fetch_array($qry_result))

Thanks for all help

OBSERVE: Im trying to avoid using another SELECT WHERE clause…
Is there a way to do what I want withouth another search?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:47:56+00:00Added an answer on May 12, 2026 at 5:47 pm

    In your query, you can use the where clause. (select * from table where column1 = ‘value’)

    Another option would be to have a counter variable that you increment in your while loop:

    $counter = 0;
    while($row = mysql_fetch_array($qry_result))
    {
        if($row[0] == "value")
           $counter++;
    }
    

    After you have this counter, reset the result set using mysql_data_seek($qry_result, 0); and then continue with your original while loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got some problem and need help .. my plan : 1. get ip
With some kindly help from StackOverflow, I've got Unity Framework to create my chained
Thanks to some help I received yesterday I've got some dynamic summing working on
Recently I got some help with grouping when a user enters a null value
I got some code off the Internet and now I just need help to
I got some problem with texture transparency, I hope ya can help. Details: XNA
I've got some issues on scripting... if someone could help me, it would be
I got some code from java httpurlconnection cutting off html and I am pretty
I want to get images from a flickr rss but this code won't get
I got some help on here last night about getting an the index of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.