ERROR: unterminated quoted string... help

ERROR: unterminated quoted string... help

am 17.05.2005 20:15:53 von Postgres User

Hi

I'm trying to insert encrypted data into the database and I'm noticing=20
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=20
('jokers', '=ïµiF=17!=B66(֟㍾óˆÌ=91'-I w=89=
iDÖiJÐÿ=86 %')

Warning: pg_query() [function.pg-query]: Query failed: ERROR:=20
unterminated quoted string at or near "'=ïµi" at character 68 in=
=20
/usr/local/apache2/htdocs/php/5/Theirry_DB.php on line 162

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Re: ERROR: unterminated quoted string... help

am 17.05.2005 20:27:12 von Scott Marlowe

On Tue, 2005-05-17 at 13:15, Postgres Admin wrote:
> Hi
>=20
> I'm trying to insert encrypted data into the database and I'm noticing=20
> error dealing with quotes. Below is the error print out...
>=20
> suggestions and/or at least point me in the direction to find a solution,
>=20
> Thanks,
> J
>=20
>=20
>=20
> INSERT INTO sample.users (user_name, first_name) VALUES=20
> ('jokers', '=ïµiF=17!¶6(ÖŸã¾=C3 =
³ˆÌ‘'-Iw‰iDÖiJÐ= C3¿â€  =
%')
>=20
> Warning: pg_query() [function.pg-query]: Query failed: ERROR:=20
> unterminated quoted string at or near "'=ïµi" at character=
68 in=20
> /usr/local/apache2/htdocs/php/5/Theirry_DB.php on line 162

Use a bytea field and use pg_escape_bytea() to prepare the data for
insertion.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Re: ERROR: unterminated quoted string... help

am 17.05.2005 20:33:03 von Postgres User

Scott Marlowe wrote:

>
>Use a bytea field and use pg_escape_bytea() to prepare the data for
>insertion.
>
>
>
Thanks Scott, I will try it now.

J

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Re: ERROR: unterminated quoted string... help

am 17.05.2005 21:17:37 von Mariusz Pekala

On 2005-05-17 14:15:53 -0400 (Tue, May), Postgres Admin wrote:
> Hi
>=20
> I'm trying to insert encrypted data into the database and I'm noticing=20
> error dealing with quotes. Below is the error print out...
>=20
> suggestions and/or at least point me in the direction to find a solution,
>=20
> Thanks,
> J
>=20
> INSERT INTO sample.users (user_name, first_name) VALUES=20
> ('jokers', '=3D??=06iF=17!?6(Ö????ó?=08??'-Iw?iDÖiJ??? %')
>=20
> Warning: pg_query() [function.pg-query]: Query failed: ERROR:=20
> unterminated quoted string at or near "'=3D??=06i" at character 68 in=20
> /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 =3D "INSERT INTO .... ('jokers','" . pg_escape_string($encrypted) .=
"');" ;

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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Re: ERROR: unterminated quoted string... help

am 18.05.2005 10:35:00 von Volkan YAZICI

SGksCgpPbiA1LzE3LzA1LCBQb3N0Z3JlcyBBZG1pbiA8cG9zdGdyZXNAcHJv
ZHVjdGl2aXR5bWVkaWEuY29tPiB3cm90ZToKPiBJJ20gdHJ5aW5nIHRvIGlu
c2VydCBlbmNyeXB0ZWQgZGF0YSBpbnRvIHRoZSBkYXRhYmFzZSBhbmQgSSdt
IG5vdGljaW5nCj4gZXJyb3IgZGVhbGluZyB3aXRoIHF1b3Rlcy4gQmVsb3cg
aXMgdGhlIGVycm9yIHByaW50IG91dC4uLgo+Cj4gc3VnZ2VzdGlvbnMgYW5k
L29yIGF0IGxlYXN0IHBvaW50IG1lIGluIHRoZSBkaXJlY3Rpb24gdG8gZmlu
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