I have basic PHP/MySql knowledge. I can create basic CRUD applications. I'm trying to slowly create more advanced display of results and I am struggling with how to display "grouped" data.
Here is an issue for a job posting site I am working on.
1) I have a simple table that is storing "how did you hear about us?" information after a visitor apply's for a job position. The table contains only 3 pieces of data (as of right now). Date of application (submitted), how did you hear about us (hdyhau) and job number (file_number).
2) There can be multiple applications for the same job number. For example: 10 entries with the same file_number.
3) I'd like to display the file_number with a count of each hdyhau used. Something similar to below:
Job Number: HDYHAU:
J1234 Google (5)
Yahoo (2)
Amazon (6)
dogpile (8)
J4321 Yahoo (4)
Amazon (2)
Dogpile (3)
Right now I can only display the data this way
J1234 Google
J1234 Google
J1234 Google
J1234 Google
J1234 Google
J1234 Yahoo
J1234 Yahoo
J1234 Amazon
J1234 Amazon
J1234 Amazon
J1234 Amazon
J1234 Amazon
J1234 Amazon
J1234 Dogpile
J1234 Dogpile
J1234 Dogpile
J1234 Dogpile
J1234 Dogpile
J1234 Dogpile
J1234 Dogpile
J1234 Dogpile
Any idea on how to create the query and php code? I've experimented with GROUP BY but it's not displaying the results. I am assuming I need to create an array of some sort....but having trouble knowing how to start it.
Thanks for all the help.