Function qpg
Quote the given string (depending on its type) so that it can be used safely in a PostgreSQL query without fear of SQL injection errors.
Although this function effectively achieves a similar goal to the pg_escape_string() function, it is needed for older versions of PHP (< 4.2.0) and older versions of PostgreSQL (< 7.2.0), however. PgQuery does not attempt to use the newer pg_escape_string() function at this stage.
This function is outside the PgQuery class because it is sometimes desirable to quote values for SQL command strings in circumstances where there is no benefit to using the class.
Package: awl\PgQuery
Copyright: Catalyst IT Ltd, Morphoss Ltd http://www.morphoss.com/
License: GNU GPL v2 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at PgQuery.php
Copyright: Catalyst IT Ltd, Morphoss Ltd http://www.morphoss.com/
License: GNU GPL v2 or later
Author: Andrew McMillan andrew@mcmillan.net.nz
Located at PgQuery.php
mixed |
$str = null |
Data to be converted to a string suitable for including as a value in SQL. |
string
|
NULL, TRUE, FALSE, a plain number, or the original string quoted and with ' and \ characters escaped |