How to Detect That WP is Using Mod Rewrite or $_GET variables?

You can check for the permalink_structure option value. If this value is an empty string, WP is using the default permalink structure (/?var1=val1&var2=val2), otherwise WP will be using the pretty permalink structure (/val1/val2):

if ('' != get_option('permalink_structure')) {
    // pretty permalink '/val1/val2'
    ...
} else {
    // default permalink '/?var1=val1&var2=val2' 
    ...
}

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