Docs for page DataUpdate.php

## /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.

- author: Andrew McMillan <andrew@mcmillan.net.nz>
- copyright: Catalyst IT Ltd, Morphoss Ltd <http://www.morphoss.com/>
- license: GNU GPL v2 or later

Classes

Class | Description
--- | ---
DBRecord | A Base class to use for records which will be read/written from the database.

Includes
require_once ('AwlQuery.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 = &quot;&quot;])

- 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 111)

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 = &quot;&quot;])

- 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 Fri, 13 Jan 2012 23:40:15 +1300 by phpDocumentor 1.4.3