Dupplication of Custom Post Type while adding attachment

Got it :

wp_update_post( array( 'ID' => $attach->ID, 'post_parent' => 0) );

to

wp_update_post( array( 'ID' => $postID 'post_parent' => 0) );

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