dimanche 1 mars 2015

Why is this mySQL UPDATE not making changes?

I know nothing about mySQL. A friend and I are struggling with this tiny bit of code.


Background:


I'm trying to solve an issue I have with character encoding on my WordPress database. My original WordPress database is wordpress, and the modified database is wordpress2 (which exists largely as a copy of the original). I want to select the post_content of a single entry in wordpress, convert it to utf8, and insert it into the corresponding row in wordpress2.


The Script:



update wordpress2.wp_posts wp2
set wp2.post_content = (select convert(wp.post_content using utf8)
from wordpress.wp_posts wp
where wp.ID = wp2.ID )
where wp2.ID = 789;


When run:



Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0


Why isn't this changing any rows? What do we need to do to make it do so?


Thank you.


Aucun commentaire:

Enregistrer un commentaire