clankill3r Posted December 23, 2011 Share Posted December 23, 2011 I have a table with words, what is a correct query to trim all words? this is wrong: $query = "UPDATE negative_words TRIM word"; it's structured like id - word - rating and negative_words is the tabel name. Link to comment https://forums.phpfreaks.com/topic/253745-trim-every-word-in-the-database/ Share on other sites More sharing options...
ignace Posted December 23, 2011 Share Posted December 23, 2011 UPDATE negative_words SET word = TRIM(word); Link to comment https://forums.phpfreaks.com/topic/253745-trim-every-word-in-the-database/#findComment-1300845 Share on other sites More sharing options...
clankill3r Posted December 23, 2011 Author Share Posted December 23, 2011 dankjewel / thanks Link to comment https://forums.phpfreaks.com/topic/253745-trim-every-word-in-the-database/#findComment-1300856 Share on other sites More sharing options...
Maq Posted December 23, 2011 Share Posted December 23, 2011 FWIW, there is also: LTRIM() for removing leading spaces. RTRIM() for removing trailing spaces. Link to comment https://forums.phpfreaks.com/topic/253745-trim-every-word-in-the-database/#findComment-1300883 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.