[nSLUG] MySQL find/replace
htheriault at gmail.com
Mon Jun 28 10:51:45 ADT 2010
That was the problem. Thanks :)
On Sat, Jun 26, 2010 at 9:50 PM, Miles Thompson <milesthom at gmail.com> wrote:
> Did you have a look at IS NULL and isnull() ?
> It's a trap I've fallen into before - "NULL" is not a real null, it's a
> How about this, untested of course:
> update wp_postmeta set meta_key = "my replacement text" where
> Cheers - Miles
> On Sat, Jun 26, 2010 at 7:14 PM, Herb <htheriault at gmail.com> wrote:
>> Hi all,
>> I'm migrating an aging drupal site to wordpress and am stuck on one of
>> my last sql tasks, involving replacing a field in one of the mysql
>> mysql> update wp_postmeta set meta_key = replace(meta_key,"NULL","my
>> replacement text");
>> Query OK, 0 rows affected (0.00 sec)
>> Rows matched: 549 Changed: 0 Warnings: 0
>> It's matching the entire column instead of the fields that are NULL
>> Attempts at changing the first bracketed field to NULL as well
>> ("NULL","NULL","my replacement text") actually fills the column with
>> the replacement.
>> Can anyone shed some light on what I'm missing?
>> nSLUG mailing list
>> nSLUG at nslug.ns.ca
> Miles Thompson
> "The piano keys are black and white,
> But they sound like a million colours in your mind"
> Spider's Web - Katie Melua
> nSLUG mailing list
> nSLUG at nslug.ns.ca
More information about the nSLUG