-
calling data from mysql
I have a database, single table that goes: Column 1- teacher_id, Column 2- name, Column 3- department. I want to have a .php page that displays each department once and lists each teacher under their correct department. Do I have to make multiple queries?
I have done a SELECT * FROM teachers and I have done a SELECT * FROM teachers WHERE department=English
I'd like to be able to pull this off with one query and without having to create a second table.
any help would be appreciated.
-
no you don't
Select *
From teachers
Group by Department
Order by Name
-
thanks for the tip, Noo Noo. I will give it a shot. I have teaching myself php through Visual quickstart php books, but I don't recall seeing the 'Group' syntax before. Appreciate the reply.