Re: underscore

Поиск
Список
Период
Сортировка
От Matthew Horoschun
Тема Re: underscore
Дата
Msg-id 1E50BE38-3411-11D7-9306-000393B3A702@canprint.com.au
обсуждение исходный текст
Ответ на Re: underscore  (ryanne cruz <ryanne.cruz@up.edu.ph>)
Ответы Re: underscore
Список pgsql-php
Hi Ryanne,

On Thursday, January 30, 2003, at 04:09  PM, ryanne cruz wrote:

> i have a column wherein a lot of entries has 2 or more names int it.
> these are
> separated by spaces. an example is: "John Doe", "Mary Margaret Smith".
> i need
> to replace the spaces with an underscore. any idea how to do this?


In PHP use preg_replace (http://php.net/preg_replace for details)

In PostgreSQL use replace(string text, from text, to text)

(http://www.postgresql.org/docs/
view.php?version=7.3&idoc=1&file=functions-string.html)

To update a column in a table, you could do something like:

UPDATE table SET column = REPLACE( column, ' ', '_' );

Matthew.

--
Matthew Horoschun
Network Administrator
CanPrint Communications Pty. Ltd.


В списке pgsql-php по дате отправления:

Предыдущее
От: ryanne cruz
Дата:
Сообщение: Re: underscore
Следующее
От: ryanne cruz
Дата:
Сообщение: Re: problem with select option