Saving a post ID to use in a form elsewhere on website

save the id in a variable like this way

$post_id = get_the_ID();

now you can use this $post_id variable in the hidden field.

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