php - Join two different tables from different database -
i have separate employee management scheme leave module, payroll computation, etc. have downloaded time in time out php source code scheme means has different database. want employees table ems connected employees table timeclock system. when add together employee ems, automatically update in employee table on timeclock.
the time clock downloaded way one: http://timeclock.sourceforge.net/
a view in timeclock system
if edit employee info ems replace employee table of timeclock scheme view reads ems table. or utilize updatable view , edit both systems.
create view timeclock_db.employee select ... ems_db.employee
same table both systems
if both employee tables identical , have way of remapping tables in 1 of systems alter mapping both systems utilize same table. table either stored in ems database or timeclock database.
triggers
i not suggest keeping 2 copies of info alternative utilize triggers on update
, insert
, delete
queries maintain info in both tables in sync.
php mysql
No comments:
Post a Comment