The left side of time is created during a loop. No database related with it.
The right side information is stored in a table-"tbl_appointment", inside has fields like: (id, start_time, end_time, date, contact_id ...); the "contact_id" is related with another table which contains people name, phone number and other information.
What I did in this for loop is:
Check time in "tbl_appointment", if there 's no start_time same as my left side of time, will display nothing; otherwise, display relative people name