PHP Object Framework (PHPOF) Manual

DBTable Class

Class for use when handling database tables.

Constructor Description

void DBTable ( &DB database, string table_name )

This class is used for handling database tables. database is a database object, and is the database which table_name must be part of. This will be the table upon which operations will be performed whilst using the DBTable object. Upon instantiation, information about the columns and primary key within table_name will be automatically fetched from the database and stored internally within the object.

The DBTable class is ideally suited as a parent for creating derived classes from. For example, if you were handling a database of hotels, you could create a derived class "Hotels" which had functions such as Hotels::FindAvailableRoom() and so on. The key point is that DBTable provides you with functions to ease the core, repetitive database interfacing such as inserting, updating and deleting rows.

Public Properties

[none]

Public Methods

::BasicSearch - Perform a search in a database table for exact matches
::BasicSearch_Paged - As DBTable::BasicSearch but with paged results
::BasicSearchLike - Perform a search in a database table for cells containing the given term
::BasicSearchLike_Paged - As ::BasicSearchLike but with paged results
::BasicSearchNot - Perform a search in a database table for all rows NOT matching the given term
::BasicSearchNot_Paged - As ::BasicSearchNot but with paged results
::DeleteRows - Delete rows matching the given criteria from the table
::GetAll - Get all rows from the table
::GetAll_Paged - As ::GetAll but with paged results
::GetArray - Get an associative array containing two fields of all rows in a table
::GetArray_Paged - As ::GetArray but with paged results

See also DBRow Class, DB_result Class.