Using $wpdb in a plugin, what sort of data does it return?

Check out the codex on wpdb. In your case, get_row returns the first row of the result set as an object. There’s no need for any mysqli_* functions when using $wpdb.

if ( $result2 )
    echo json_encode( $result2 );

And a heads up for SQL injection – use the prepare method:

$wpdb->get_row(
    $wpdb->prepare(
        "SELECT * FROM {$myoptionValue['tablename']} WHERE personeelsNummer = %s",
        $q
    )
);

If personeelsNummer is an integer, use the placeholder %d instead of %s

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