wp_insert_post removes information when updating

You are using the wrong function. wp_insert_post() is for creating posts. You need wp_update_post() if you want to update existing data.

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