File/DataUpdate.php

Description

Some functions and a base class to help with updating records.

This subpackage provides some functions that are useful around single record database activities such as insert and update.

Classes
Class Description
 class DBRecord A Base class to use for records which will be read/written from the database.
Includes
 require_once ('PgQuery.php') (line 16)
 require_once ('AWLUtilities.php') (line 15)
Functions
sql_from_object (line 28)

Build SQL INSERT/UPDATE statement from an associative array of fieldnames => values.

  • return: An SQL Update or Insert statement with all fields/values from the array.
string sql_from_object (array $obj, string $type, string $tablename, string $where, [string $fprefix = ""])
  • array $obj: The object of fieldnames => values.
  • string $type: The word "update" or something else (which implies "insert").
  • string $tablename: The name of the table being updated.
  • string $where: What the "WHERE ..." clause needs to be for an UPDATE statement.
  • string $fprefix: An optional string which all fieldnames in $assoc are prefixed with.
sql_from_post (line 110)

Build SQL INSERT/UPDATE statement from the $_POST associative array

  • return: An SQL Update or Insert statement with all fields/values from the array.
string sql_from_post (string $type, string $tablename, string $where, [string $fprefix = ""])
  • string $type: The word "update" or something else (which implies "insert").
  • string $tablename: The name of the table being updated.
  • string $where: What the "WHERE ..." clause needs to be for an UPDATE statement.
  • string $fprefix: An optional string which all fieldnames in $assoc are prefixed with.

Documentation generated on Thu, 15 Apr 2010 20:23:04 +1200 by phpDocumentor 1.3.2