Filter users in a search

Check the arguments for get_users()

https://developer.wordpress.org/reference/functions/get_users/

What you should do is

$users = get_users( array( 'role__not_in' => array( 'administrator' ) ) )

Then

foreach ( $users as $user ) ...

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