Ragazzi ho circa 30.000 record con le e-mail scritte in questo modo: patate@miodominio.it
Devo sostituire @ con la @. Posso fare il tutto solo in sql senza per forza fare un str_replace in php??
grazie
Ragazzi ho circa 30.000 record con le e-mail scritte in questo modo: patate@miodominio.it
Devo sostituire @ con la @. Posso fare il tutto solo in sql senza per forza fare un str_replace in php??
grazie
Originariamente inviato da massimo80
Ragazzi ho circa 30.000 record con le e-mail scritte in questo modo: patate@miodominio.it
Devo sostituire @ con la @. Posso fare il tutto solo in sql senza per forza fare un str_replace in php??
grazie
scusa mi ha preso i caratteri in modo non corretto.
devo sostituire
con @Codice PHP:
@
da manuale mysql:
....
REPLACE(str,from_str,to_str)
Returns the string str with all occurrences of the string from_str replaced by
the string to_str:
mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'
This function is multi-byte safe.
.....
per cui si puoi solo con sql.
inoltre ti può essere di aiuto ...
INSTR(str,substr)
Returns the position of the first occurrence of substring substr in string str.
This is the same as the two-argument form of LOCATE(), except that the arguments
are swapped:
mysql> SELECT INSTR('foobarbar', 'bar');
-> 4
mysql> SELECT INSTR('xbar', 'foobar');
-> 0
This function is multi-byte safe. In MySQL 3.23 this function is case sensitive,
while in 4.0 it’s only case sensitive if either argument is a binary string.
Scusate se mi intrometto...ma l' argomento mi interessa ed essendo veramente scarso in sql ne approfitto...![]()
se ho una tabella così:
come faccio ad ottenere (in SQL):codice:TABLE_1 +-----+--------+------------+ | id | campo1 | data | +---------------------------+ | 1 | onno | 0000-00-00 | |---------------------------| | 2 | moro | 0000-00-00 | |---------------------------| | 3 | dono | 0000-00-00 | +---------------------------+
codice:TABLE_1 +-----+--------+------------+ | id | campo1 | data | +---------------------------+ | 1 | AnnA | 0000-00-00 | |---------------------------| | 2 | mArA | 0000-00-00 | |---------------------------| | 3 | dAnA | 0000-00-00 | +---------------------------+
www.bitmade.com Momentan ist richtig_Momentan ist gut_Nicht ist wirklich wichtig_Nach der Ebbe kommt die Flut_ _Am Strand des Lebens_ohne Grund,ohne Verstand_ist nichts vergebens_ich baue di traeume auf den Sand.
update `table_1` set campo1=replace(campo1,'o','A')
(mi sento idiota)
Grazie 1000!![]()
![]()
www.bitmade.com Momentan ist richtig_Momentan ist gut_Nicht ist wirklich wichtig_Nach der Ebbe kommt die Flut_ _Am Strand des Lebens_ohne Grund,ohne Verstand_ist nichts vergebens_ich baue di traeume auf den Sand.