wp_insert_user not returning anything

I found out what it was.

I had an action hook for user_register on my functions.php. This action hook would automatically login the user after registration. After removing it, it worked.

As requested, the hook was interfearing because I was already logged in. The hook would use wp_set_current_user($user_id); wp_set_auth_cookie($user_id); to log in after registration.

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