Update query with wildcards

I am new to sql and trying to update a bunch of records , i tried selecting them all, and they came fine when i used the wildcards, but now when i run the following command, it returns, 0 rows affected.

UPDATE wp_comments
SET comment_author_url= '/wp-content/themes/abc/images/new.png'
WHERE comment_author_url= '/gender/%'

am i missing something, or the wildcards doesn’t work with update?

was that ampersand supposed to be a mysql wildcard? because it isn’t

sorry, my mistake. i later on fixed it and retried it, but didn’t work. am i missing something

it didn’t work if you used an equal sign – you need to use LIKE

Here is the update statement:


UPDATE wp_comments
SET comment_author_url= '/wp-content/themes/abc/images/new.png'
WHERE comment_author_url LIKE '/gender/%'