calling data from mysql
Results 1 to 3 of 3

Thread: calling data from mysql

  1. #1
    Registered User cgonzo's Avatar
    Join Date
    Dec 2002
    Posts
    114

    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.

  2. #2
    Driver Terrier NooNoo's Avatar
    Join Date
    Dec 2000
    Location
    UK
    Posts
    31,824
    no you don't

    Select *
    From teachers
    Group by Department
    Order by Name

  3. #3
    Registered User cgonzo's Avatar
    Join Date
    Dec 2002
    Posts
    114
    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.

Similar Threads

  1. Recovering data from dead hard drive?
    By PacMan in forum Hard Drive/IDE/SCSI Drivers
    Replies: 7
    Last Post: March 29th, 2013, 12:16 PM
  2. excel date formulae?
    By Stanley_Kubrick in forum Microsoft Office
    Replies: 7
    Last Post: April 2nd, 2003, 06:03 PM
  3. Laptop data copy problem
    By Garfield99 in forum Tech-To-Tech
    Replies: 3
    Last Post: February 18th, 2003, 05:37 PM
  4. New Win98SE install only recognizes audio, not data CDs
    By Bill_from_LA in forum CD-ROM/CDR(-W)/DVD Drivers
    Replies: 3
    Last Post: May 16th, 2002, 06:36 AM
  5. recover data from an erased cd-r
    By erik0103 in forum CD-ROM/CDR(-W)/DVD Drivers
    Replies: 3
    Last Post: May 23rd, 2001, 01:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •