How to tell if the user is an admin?

Yes, that’s good.

You can be a little safer using <?php if(current_user_can('manage_plugins') ); ?>

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