Retrieving comma sperated record from sql
07:03 09 Jan 2013

I have tree tables in a database

  1. Student (student_id,first_name,last_name)
  2. Employee (employee_id,full_name,last_name)
  3. Message (message_id,sender_id,reciever_ids,msg)

When student/employee sends a message to a students's or employee's reciever_id containt comma spertated value like 1-1,2-45,1-25).

2-45 shows its an employee and 45 is his id and in "1-25" 1 shows its a student and 25 shows its is his id.

now how can i triverse that reciever_ids to get the relevant record?

sql mysql