I have thousands of entries in a wordpress site with a custom field called description
and inside all of them, I have a leading white space, like this:
" bla, bla, bla"
And I need to remove all that white spaces like this:
"bla, bla, bla"
I was trying to do this $sql = "UPDATE $wpdb->postmeta set description = ltrim(rtrim(description))";
but is not working.
phpmyadmin says: # 1054 - Unknown 'description' column in 'field list'
Is it possible, and or how?
2
Answers
you can use the TRIM function of MySQL (See reference)
Try to write trim in Capital