how can i check the WordPress is running on local server or is on live server through code

how can i check the WordPress is running on local server or is on live server through code

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