get_the_ID() fails the first time, returns a value the second time it’s called

get_the_ID() fails the first time, returns a value the second time it’s called

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