Hi,
I had 3 tables. Users,Admins,Vendors.
When a user register 's it can be approved by either vendor or admin.
I am storing the approved_type and approved_id who approved it in the Users Table.
For example if an Admin approves an user i am saving approved_type as A and his AdminID.
If a vendor approves i am saving approved_type as V and his vendorID.
I would like to show the complete data of the Users table such as .
Username User email Approved by Approver name registered date.
Ex: Shiva shiva@test.com Vendor raghu(Vendor Name) 2015-03-04
Based upon the approved_type of each record i need to fetch the name of the approved person either from Admin table or Vendor Table..
Can you please help me with some solution on this.