my hook or my function wont run in the cronjob

I got it.

Im developing a plugin for woocommerce, so i was adding my Function to my plugin page instead of my include of the functions. Just put it on the functions and it works.

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