Re: ERROR: unterminated quoted string... help

Поиск
Список
Период
Сортировка
От Mariusz Pękala
Тема Re: ERROR: unterminated quoted string... help
Дата
Msg-id 20050517191737.GA11375@cthulhu.sdi.tpnet.pl
обсуждение исходный текст
Ответ на ERROR: unterminated quoted string... help  (Postgres Admin <postgres@productivitymedia.com>)
Список pgsql-php
On 2005-05-17 14:15:53 -0400 (Tue, May), Postgres Admin wrote:
> Hi
>
> I'm trying to insert encrypted data into the database and I'm noticing
> error dealing with quotes. Below is the error print out...
>
> suggestions and/or at least point me in the direction to find a solution,
>
> Thanks,
> J
>
> INSERT INTO sample.users (user_name, first_name) VALUES
> ('jokers', '=??iF!?6(Ö????ó???'-Iw?iDÖiJ??? %')
>
> Warning: pg_query() [function.pg-query]: Query failed: ERROR:
> unterminated quoted string at or near "'=??i" at character 68 in
> /usr/local/apache2/htdocs/php/5/Theirry_DB.php on line 162

You should pass the encrypted data thru pg_escape_string() function.
You surely should do it with almost EVERY string that you put as an
argument in a query, especially if it comes from 'outside'.

$query = "INSERT INTO .... ('jokers','" .  pg_escape_string($encrypted) . "');" ;

--
bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~

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

Предыдущее
От: Postgres Admin
Дата:
Сообщение: Re: [SQL] ERROR: unterminated quoted string... help
Следующее
От: Volkan YAZICI
Дата:
Сообщение: Re: ERROR: unterminated quoted string... help