How and when would I implement some code which would take data from one part of the Db and put it in another?

How and when would I implement some code which would take data from one part of the Db and put it in another?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)