Removing plugin settings from database

WordPress has a function called register_deactivation_hook which registers a plugin function to be run when the plugin is deactivated, so:

register_deactivation_hook( __FILE__, 'myplugin_deactivate' );
function myplugin_deactivate(){
   //delete plugins option here ex:
   delete_option('pa_options');
}

Update:
Like One Trick Pony mentioned, sometimes users deactivate plugins and when they reactivate it they will loose all settings if you use this method.

So a better one would be to create an uninstall option in your plugin’s admin panel and submitted, only then you should remove the options from the database and deactivate the plugin using deactivate_plugins( '/plugin-folder/plugin-name.php' );

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