Custom ajax call returns 0 [duplicate]

Modify your registerform() function to include die() after you echo your response. Example:

function registerform(){
    echo $_POST['name'];
    die();
}
add_action('wp_ajax_registerform', 'registerform');
add_action('wp_ajax_nopriv_registerform', 'registerform');

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