Plugin Modification Change Functionality For Logged User Only

Yes, I think your quotes after the WHERE are backwards. Try it like this:

...$fields.' WHERE wp_users.ID='.$current_user->ID );

The “WHERE wp_users.ID=” part is plain text that is intended to be part of the query, so it needs to be in quotes. The $current_user->ID is a variable that should live outside the quotes.

If that doesn’t work, I would suggest using a variable to store the SQL query and then output it as debugging. That way you can see what is being formed and see if it is what you expect.

This is how I do it:

$sql = db->prepare( "SELECT * FROM $table WHERE user=%s", $current_user->ID );

Hope this helps!

BTW, it took me awhile to get used to using a period as a concatenation operator.