Overview

Packages

  • awl
    • AuthPlugin
    • AwlDatabase
    • Browser
    • classEditor
    • DataEntry
    • DataUpdate
    • EMail
    • iCalendar
    • MenuSet
    • PgQuery
    • Session
    • Translation
    • User
    • Utilities
    • Validation
    • vCalendar
    • vComponent
    • XMLDocument
    • XMLElement
  • None

Classes

  • PgQuery

Functions

  • awl_replace_sql_args
  • clean_string
  • connect_configured_database
  • duration
  • qpg
  • Overview
  • Package
  • Function

Function awl_replace_sql_args

Replaces PostgreSQL query with escaped parameters in preparation for execution.

The function takes a variable number of arguments, the first is the SQL string, with replaceable '?' characters (a la DBI). The subsequent parameters being the values to replace into the SQL string.

The values passed to the routine are analyzed for type, and quoted if they appear to need quoting. This can go wrong for (e.g.) NULL or other special SQL values which are not straightforwardly identifiable as needing quoting (or not). In such cases the parameter can be forced to be inserted unquoted by passing it as "array( 'plain' => $param )".

This function is outside the PgQuery class because it is sometimes desirable to build 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
Return value summary
The built query string
API documentation generated by ApiGen