I have a keywords column and it contains stuff like this:
apples, oranges, pine apple
I'm trying to change the spaces to hyphens using this query"
UPDATE articles SET keywords = REPLACE(keywords," ","-") WHERE keywords REGEXP '[A-Z] [A-Z]' limit 1;
But this adds hyphens where I don't want them, like this:
apples,-oranges,-pine-apple
Can this be done with REGEXP? Or will I need to involve PHP?
Thank you.