Re: Strange pg_escape_string behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* -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.
-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux