I want to get some statitics out for my adminpanel.
I have two tables named users and cms_prosjekt. I want to count how many projects
that have the same attribute as users.
Each user have a motto that is connected to a project.
For example: Motto is spirit and the project code is spirit. It won't return anything. I have two users with the same motto as code in a project.
$result = mysql_query("SELECT
COUNT(users.motto) AS count
LEFT JOIN cms_prosjekt ON
$num_rows = mysql_num_rows($result);
The query should be count(*) and group by user.motto
"SELECT user.motto , COUNT( * ) AS count FROM users LEFT JOIN cms_prosjekt ON users.motto=cms_prosjekt.code GROUP BY users.motto"