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…
Use this query:
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:
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.