Posted by Curt Zirzow on 10/19/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.
--
Navigation:
[Reply to this message]
|