|
Posted by Ewoud Dronkert on 11/03/05 11:23
VooDoo wrote:
> How can i do an update on this table to replace only the characters
> 'é' or 'è' by a 'e'.
In PHP:
$subject = 'somé linè';
$search = 'éè';
$replace = 'ee';
$updated = strtr($subject, $search, $replace);
or
$subject = 'somé linè';
$search = array('é', 'è');
$replace = 'e';
$updated = str_replace($search, $replace, $subject);
But I guess you need a SQL query ("table with a field"). Better ask in
comp.databases.mysql or have a look at
http://dev.mysql.com/doc/refman/4.1/en/string-functions.html It might be
UPDATE t1 set f1 = REPLACE(REPLACE(f1, 'è', 'e'), 'é', 'e')
--
E. Dronkert
Navigation:
[Reply to this message]
|