What is wrong with this wpdb update?

you’re creating the $data and $where values as strings, not arrays.

this:

$data = "array( 'somecol' => '".$newstr."' )";
$where = "array( 'id' => ".$defid." )";

should be:

$data = array( 'somecol' => $newstr );
$where = array( 'id' => $defid );

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