Reply to Re: [PHP] Strange pg_escape_string behavior

Your name:

Reply:


Posted by Curt Zirzow on 10/20/24 11:31

* -k. wrote:
> ...
> pg_exec(): Query failed: ERROR: invalid regular expression: invalid escape \ sequence .
>
> It seems to happen when using just a "\" or text ending with a "\" but not if a "\" is in the
> middle of a string of text.

I would guess you have magic_quote_gpc on, you can check this:

var_dump(get_magic_quotes_gpc());

> ...
> $user_item = pg_escape_string($_POST['user_item']);
>
> $dbconn = pg_connect('some connection string that works');
> $query = "SELECT * FROM some_table WHERE some_col = '$user_item' ";

Try an:
echo htmlentities($query);

And you'll see the problem with the query.


Curt.
--

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация