How can I get the post id from within functions.php

You can call “id” but object call as “ID”
Please Replace with this code

global $post ;
$id = $post->ID ;

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