Using $wpdb->update but confused on the WHERE in and SET

You need to look at the documentation for the function, which is available here.

The function takes the following arguments:

  • $table The table name.
  • $data A PHP array where the keys are the columns and the values are the the values to be inserted into those columns.
  • $where A PHP array where the key is the column name, and the value is the value to be checked.

And two more optional arguments that can be used to force the values of 2nd and 3rd arguments to be certain types. See the documentation for more on those.

What you’ve done is mixed up PHP and SQL syntax for the 2nd and 3rd arguments ($row->ip_address_01 = $ipONactivate is assigning $ipONactivate to $row->ip_address_01, not making an array). You’re also trying to use the column value of a previous query (eg. $row->ip_address_01) as the column name.

You need to format your arguments like this:

$wpdb->update(
    $ipn_table,
    array( 
        'ip_address_01' => $ipONactivate
    ),
    array(
        'payer_email' => $serial,
        'item_name'   => $product,
    )
);

That function will update the ip_address_01 column, of any row where payer_email is $serial and item_name is $product. The equivalent SQL would be:

$sql = "UPDATE {$ipn_table} SET ip_address_01='{$ipONactivate}' WHERE payer_email="{$serial}" AND item_name="{$product}"";

The advantage of the function is that it saves you having to write the full query (you only need the column names and values) and it also properly prepares and escapes the values for you, so you don’t end vulnerable to SQL injections (which you would be if you used my SQL example as-is).