How to retrieve the postID in a “image_send_to_editor” hook function?

This should work within your function:

get_post_field( 'post_parent', $id )

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