Best way or practice to traverse multiple databases in MySQL using PHP -


i have restaurant booking website. each restaurant has own database. ex: r1 has dr1 db, r2 has dr2 db, etc...

bookings can made through either parent site(my booking site) or various classified sites(third party sites). ex: r1 , r2 referred classified site(cl_site1).

 db: dr1 table: booking id customer time  date       ref_by  ----------------------------------- 1  xxx      19:30 31/05/2015 cl_site1 2  yyy      20:00 05/06/2015 cl_site2 3  zzz      21:00 04/06/2015 parent ...  db: dr2 table: booking id customer time  date       ref_by  ------------------------------------ 1  aaa      19:30 02/06/2015 cl_site1 2  ccc      20:00 03/06/2015 cl_site3 3  bbb      21:00 07/06/2015 parent ... 

like wise have 100s of restaurants , 1000s of bookings.

now want build new site these classified sites(site1, site2, etc...) can fetch corresponding bookings of restaurants referred them(site1 can fetch r1 , r2 bookings referred site1).

i think it's not practice if fetch data traverse each , every database in run time.

let me know way should follow in mysql in efficient way.

thanks


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -