Re: Escaping metacharacters

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Escaping metacharacters
Дата
Msg-id 40FB2319.7010209@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: Escaping metacharacters  (Oliver Elphick <olly@lfix.co.uk>)
Список pgsql-hackers
>>>function SQLString($s) {
>>>    $s = str_replace("'", "\\s", $s)'
>>>    $s = str_replace("\\", "\\\\", $s);
>>>    return "'" . $s . "'";
> 
> 
> Have you looked at the function PQescapeString() in the libpq library? 
> Using that would seem to be a simpler way of solving this problem.

If he's using PHP, he should be using the pg_escape_string() function.

Chris



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

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: Toward better documentation
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Toward better documentation