HElp in select statment plz
hello i have three tables:
tbl_student holding students details and tb_supervisor holding supervisors details and tbl_allocating holding students who will/are allocated.
i just want to select the names of students who are 'Allocated' by supervisor id '3000'.
key words: super_id = supervisors' id, stud_id: students id
PHP Code:
tbl_allocating:
+----------+---------+----------+----------+----------------+------------+
| alloc_id | options | stud_id | super_id | allocated_flag | date_today |
+----------+---------+----------+----------+----------------+------------+
| 1 | 1 | 22124401 | 3000 | Allocated | 2005-04-19 |
| 37 | 2 | 45455656 | 2000 | Rejected | 2005-04-20 |
| 6 | 1 | 93 | 1000 | Allocated | 2005-04-19 |
| 11 | 1 | 793271 | 2000 | Allocated | 2005-04-19 |
tbl_student:
+----------+--------------+-----------+------------+------------------+----------------+
| stud_id | password | fname | lname | allocated_superv | date_allocated |
+----------+--------------+-----------+------------+------------------+----------------+
| 22124401 | jamaica123 | Royan | Gooden | 3000 | 2005-04-19 |
| 93 | ja | Ivy | Echebima | 1000 | 2005-04-19 |
| 222 | bigman | Abdi | Razak | NULL | 0000-00-00 |
tbl_supervisor:
+----------+------------+-------+-------------+-------------+----------------+-----------------+-----------+
| super_id | password | title | super_fname | super_lname | total_students | total_unlocated | privilege |
+----------+------------+-------+-------------+-------------+----------------+-----------------+-----------+
| 1000 | javapro | Prof. | Robert | Zimmer | 4 | NULL | 0 |
| 3000 | logo | Dr. | Mark | Bishop | 3 | NULL | 0 |
| 4000 | swarm | Dr. | Tim | Blackwell | 3 | NULL | 0 |
| 2000 | srilanka | Dr. | Sebastian | Danicic | 4 | NULL | 1 |