|
Posted by Koncept on 01/16/07 14:41
In article <45acc85d$0$297$426a74cc@news.free.fr>, severin
<severin.richard@free.fr> wrote:
> I'm searching a mysql syntax to do all thouses updates in one only
> query. Probably using regexp but i don't know how??
As far as I am aware, the regexp function in MySQL is only for string
comparison and does not work for substitutions. You will have to manage
this via PHP or string together a query with a ton of replace() to
handle all your replacements.
On the other hand, this is an example of how you can do it in PHP:
$str = "\t\r\ntest\ning\r123\r\n";
echo preg_replace( '/[\r\n \t]+/', "", $str );
--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche
Navigation:
[Reply to this message]
|