Saving custom taxonomies to post as checkbox on frontend

Change the value of each checkbox to term slug instead of name, and change

wp_set_post_terms($pid,array($_POST['genre']),'gen re',true);

To

 wp_set_post_terms($pid,(array)$_POST['genre'],'gen re',true);

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