SQL query to update account information?
-
Hey,
All right, a little back story first. ??
A few years ago I deiced to start a blog for school. At the time it was private and on a intranet domain. I’ve left hundred of comments over the years. Of course since then, all of my account information has changed, and multiple times at that. That is, my posting name (user name), E-mail, and URI.
Today I use plug-ins such as Author Highlight, which help my comments stick out from the rest. That is, so it’s easy to tell when I, the lone administrator, has left an official comment.
So now I would like to change the SQL data for all of my old comments so that they all have my valid account information. With the bonus being, that Author Highlight and other plug-ins will work for all comments, instead of just new ones that include my updated account information.
I believe an SQL query will do this easily, the problem being I am a complete newbie and have no clue where I would even begin. Basicly, I only now how to display data.
Which is like this:
SELECT *
wp_comments
FROM
comment_author
WHERE= 'oldAuthor'
comment_author
OR= 'newAuthor'
comment_author_email
AND= '[email protected]'
comment_author_email
OR= '[email protected]'
comment_author_url
AND= 'https://www.oldsite.com/'
comment_author_url
OR= 'https://www.newsite.com/'
comment_ID
ORDER BYASC
LIMIT 0 , 30380 Total
So those 380 are all of my comments.
All the old ones need to be updated with my new account information.
Wow, that would suck big time having to do it by hand. Got to love the power of SQL. ??
Thanks a lot,
Will
- The topic ‘SQL query to update account information?’ is closed to new replies.