I’ve seen some posts on here regarding similar ideas to this, but to be specific I thought I should point out my requirement exactly.
I have a database driven site, and the client wants a replica of it for users from the USA. They want most of the site to be the same, except some of data, which they want to be different for US visitors.
The site runs on a php/MySQL database content management system I have written. I think we are going to approach the ‘USA’ version like this…
Place a clone of the whole site in a folder called /us (no surprises there)
Duplicate all the tables, but precede the names with us_
I’m thinking, of adding a field to the original sites tables called ‘replicate’ for example, and then every 15 mins or so, run a script to copy all the records from the original table to the us_ tables where the replicate field is marked yes
On the US version of the content management system, all records that are copied from the UK site are somehow locked so only records marked no at the original site can differ on the UK site.
Does this sound like I’m heading along the right lines ?
Why not make a new database for ONLY the tables/rows that are for US visitors only.
make a php array or something that says what table should be called from what database.
Seems like less effort to me.