Frage
Gibt es in MySQL eine Funktion wie str_replace in PHP
Ich suche eine Möglichkeit wie in PHP mit der Funktion str_replace() in MySQL Ersetzungen vorzunehmen. Gibt es in MySQL eine ähnliche Funktion wie str_replace()?
0
Antwort
Antwort von coder | vom 07.04.2014 - 22:51
Zur PHP-Funktion str_replace gibt eine nahezu identische Funktion in MySQL ...
Beispiel in PHP
$content = str_replace('und','&',$content);
Beispiel in MySQL
UPDATE `table` SET `content` = REPLACE(`content`,'und','&') WHERE ...
Beispiel in PHP
Code
01
02
03
02
03
$content = str_replace('und','&',$content);
Beispiel in MySQL
Code
01
02
03
02
03
UPDATE `table` SET `content` = REPLACE(`content`,'und','&') WHERE ...
0