php - How can I get the extrapolated version of a parameterized query? -


I am trying to update the database library that we use to use parametric queries so that colleagues Too much information should not be remembered to avoid input about SQL injection and would have to pass through the array of parameters instead (I am using).

However, I am running into a problem. One requirement of database library is that it logs every query that is executed and I can not figure out any way to get the text of a parameterized query after filling out the parameters. Is there any way to do this (aside from rolling your own function for the paramedit questions)?

  pg_query_params ('SELECT id from table WHERE foo = $ 1', array ('bar') while executing parameterized query);  

I like something

  SELECT id from table WHERE foo = 'bar'  

PostgreSQL differing parameters from the extended protocol (which is used by pg_query_params ) Does.

The questions are ultimately created on the server side only, there is no way to create them on the client side using the capabilities of PostgreSQL .

You

Update:

Parameters before you send the parameter using the value of the values ​​provided Can log and query the query. Those files or syslog (including the bound parameter) will log queries on the server side, then periodically load this file in the PostgreSQL table.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -