Unclassified NewsBoard Code Reference

IDatabase class

Handles the database connection. This is the database abstraction layer. You
can replace this file by a copy of it to support other database systems than
MySQL. This class uses the 'mysql' PHP extension.

Methods:

AddField Add a field (column) to a table
AddIndex Add an index to a table
AddRecord Add a new record
AffectedRows Get the number of rows affected by the last operation
ChangeField Alter a field (column) name or type in a table
ChangeRecord Change a record
Close Terminate connection to DB server
CreateTable Create a new table in our database
Exec Run an SQL query on the database
FastQuery Perform query and get first record in one call
Further calls of GetRecord are possible
Parameters are the same as with the above Set*() function calls
FastQuery1st Same as FastQuery but return the first column's value
Further calls of GetRecord are possible
FastQuery1stArray Same as FastQuery1st, but copies all records in an array
FastQueryArray Same as FastQuery1stArray, but copies records ENTIRELY into the array
Forget Forget login account data, for security reasons
GetCount Get the total number of database queries so far
GetRecord Get next recordset of previous query
GetTableSize Get database table size, depends on table_status()
GetTime Get the total amount of time spent in queries so far
IsConnected Check if we're connected
LastError Tell the last error
ListTableCols Get a list of all columns in a table
NewQuery Reset all parameters for a new query
Open Establish connection to DB server
QueryFields Perform query on given fields
RemoveField Remove a field (column) from a table
RemoveIndex Remove an index from a table
RemoveRecord Delete a record
RemoveTable Remove a table from our database
RenameTable Rename a table
ResetStat Reset internal statistics counters
SetGroup Set new group for queries (GROUP BY section)
SetHaving Set new having for queries (HAVING section)
SetLimit Set new limit for queries (LIMIT section)
SetOrder Set new order for queries (ORDER BY section)
SetTable Set new table name for queries (FROM section)
SetWhere Set new criteria for queries (WHERE section)

Public fields:

dbname  –  default: ''
database name
password  –  default: ''
server  –  default: ''
port number may be added automatically!
tblprefix  –  default: ''
entire string, for tables like "bb1_Users", this must be "bb1_"
useUTF8  –  default: true
Use UTF-8 character set if available
user  –  default: ''
version  –  default: 0
MySQL server version

Private fields:

conn  –  default: false
q_group  –  default: ''
q_having  –  default: ''
q_limit  –  default: ''
q_order  –  default: ''
q_table  –  default: ''
q_where  –  default: ''
result  –  default: false
tablestatus  –  default: false

Implementation file: unb_lib/database.lib.php, line 23

© 2006 Yves Goergen. Unclassified NewsBoard Homepage. Reference based on UNB unb.devel.20060128, dated 2006-01-28.