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

  • Home
  • SEARCH
  • 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 8357649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:32:50+00:00 2026-06-09T10:32:50+00:00

I have this problem on PHP MYSQL this is my database sample id word

  • 0

I have this problem on PHP MYSQL
this is my database sample

id word email
1  Helo jon@gmail.com
2  Sim  jon@gmail.com
3  Sam  jon@gmail.com
4  Mac  mars@gmail.com
5  Mimic mars@gmail.com

now what i was trying to solve here is that how can i count the email with same email for example
OUTPUT web page :

id word email          submitted words dictionary
1  Helo jon@gmail.com        3         regular
2  Sim  jon@gmail.com        3         regular
3  Sam  jon@gmail.com        3         regular
4  Mac  mars@gmail.com       2         regular
5  Mimic mars@gmail.com      2         regular

the submitted words is the count of the email.
how can i work it out on php to count the same email and output 3…

  • 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-06-09T10:32:54+00:00Added an answer on June 9, 2026 at 10:32 am

    Use this query:

    SELECT email, COUNT(*) AS nb_emails
    FROM your_table
    GROUP BY `email`
    

    It will return for each email in your table the number of associated records.

    If you are using mysql_* functions, you may fetch all values using that code:

    $sql = "SELECT email, COUNT(*) AS nb_emails
              FROM your_table
              GROUP BY `email`";
    $res = mysql_query($sql);
    while($row = mysql_fetch_assoc($res))
    {
        // do something with the values of the last fetched record. The values are stored in $row['email'] and $row['nb_emails']
    }
    

    Note: Use of the MySQL extension is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information.

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

Sidebar

Related Questions

I have this problem getting my newly created php project on Netbeans work on
i have this strange problem with the PHP function CTYPE_ALNUM if i do: PHP:
so I have this problem I have 3 files like 2.php <?php $variable =
I have this weird problem with setting up cookies with PHP. Everything worked fine
Dear everybody who can help, I have this PHP > MongoDB problem, I want
I have this problem: $id is id for each user $img = 'http://www.somesite.com/pictures/'; $no_img
I am relatively new to PHP/MySQL and have been having a problem that I
I have found this popular PHP/MySQL Script called Zip Location by SaniSoft and it
My problem in fairly simple. I have a login system constructed using php, mysql
I have started programming for sometime with PHP using MySQL as the database and

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.