Re: Automatic Addslashes
От | GH |
---|---|
Тема | Re: Automatic Addslashes |
Дата | |
Msg-id | 20001124064216.D34282@over-yonder.net обсуждение исходный текст |
Ответ на | Automatic Addslashes ("Enrico Comini" <algobit@algobit.com>) |
Список | pgsql-general |
On Fri, Nov 24, 2000 at 01:29:41PM +0100, some SMTP stream spewed forth: > I do > > copy tmp from '/home/algobit/product.txt > > tmp ia a table with one record (line varchar(255)) > > in product.txt I have many line as: > > 2;"100";"Parmigiano Reggiano";"Parmigiano Reggiano stagionato 2 > anni";4;"parmigiano4.jpg";2;"Fette 1 Kg";0.18;1;1.00;"true" > > Then with "select * from tmp" the result is exactly like in the original > file > > 2;"100";"Parmigiano Reggiano";"Parmigiano Reggiano stagionato 2 > anni";4;"parmigiano4.jpg";2;"Fette 1 Kg";0.18;1;1.00;"true" > > But when i fetch in a variable the rercords (with php) i READ in the > variable > > 2;\"100\";\"Parmigiano Reggiano\";\"Parmigiano Reggiano stagionato 2 > anni\";4;\"parmigiano4.jpg\";2;\"Fette 1 Kg\";0.18;1;1.00;\"true\" > > the question is : The SLASH are effectively in the record ? Not if, as you say, a regular non-php select returns the "original" record. Likely, your PHP setup has magic_quotes_runtime (or magic_quotes_gpc) set to On. This would cause PHP to "addslashes()" to the data gathered from the db (also true for forms, etc). Make sense? You can use get_magic_quotes_runtime or get_magic_quotes_gpc to retrieve the current setting of the two options. http://www.php.net/manual/configuration.php#ini.magic-quotes-gpc gives a nice summary. cheers. gh >
В списке pgsql-general по дате отправления: