title: Counting multiple entries in a MySQL database?
body: <p>I'm trying to count multiple entries in a MySQL database, I know how to use COUNT(), but the exact syntax I want to get the results I need eludes me.</p>
  
  <p>The problem:
  Table structure: ID, CODE, AUTHOR, COUNTRY, TIMESTAMP.</p>
  
  <p>Code, Author and Country overlap many times in the table. I am trying to discover if there is one simple query that can be ran to return (using WHERE clause on COUNTRY) the author field, the code field, and then a final field that counts the number of times the CODE was present in the query result.</p>
  
  <p>So, theoretically I could end up with an array like:</p>
  
  <pre><code>array('author', 'code', 'codeAppearsNTimes');
  </code></pre>
  
  <p>Authors also have varying codes associated with them, so I don't want the results merged. I suppose the end result would be: 'This author is associated with this code this many times'.</p>
  
  <p>Is this possible with MySQL?</p>
  
  <p>Thanks in advance.</p>