Constructor
AbstractDB
AbstractDB
(String $libraryPath, String $dbType, [Integer $preferredResType = ANYDB_RES_ASSOC])
-
String
$libraryPath: path to the database abstraction layer
-
String
$dbType: identifier of the db type
-
Integer
$preferredResType: the preferred result type
Returns how many rows were affected by the last statement
Mixed
affectedRows
()
Redefined in descendants as:
Connects to the db
Boolean
connect
(String $host, String $db, String $user, String $password, [mixed $persistent = false], Boolean $persistent
)
-
String
$host
-
String
$db
-
String
$user
-
String
$password
-
Boolean
$persistent
Redefined in descendants as:
Closes the db connection
Boolean
disconnect
()
Redefined in descendants as:
Modifies a string to make it secure to add to the db
Mixed
escapeStr
(Mixed $str, [Array $keys = null])
-
Mixed
$str: a string or an array
-
Array
$keys: if not null it specifies which key names to use
Redefined in descendants as:
Executes a statement and returns the result table
Mixed
execute
(String $query, [Integer $resultType = ANYDB_PREDEFINED_VALUE])
-
String
$query: a sql statement
-
Integer
$resultType: should the array have numeric, associative keys, or both
Redefined in descendants as:
Frees the memory from the result set
Mixed
free
()
Redefined in descendants as:
Returns the resulting table in an 2-dimensional array
Mixed
getAll
([Integer $resultType = ANYDB_PREDEFINED_VALUE])
-
Integer
$resultType: should the array have numeric, associative keys, or both
Redefined in descendants as:
Returns a result column after an apropriate sql statement
Mixed
getColumn
([Integer $resultType = ANYDB_PREDEFINED_VALUE])
-
Integer
$resultType: should the array have numeric, associative keys, or both
Redefined in descendants as:
Checks if a dataset exists and returns the id if so
Mixed
getDataId
(String $table, Array $array, [Array $fields = null], [String $id_field = 'id'])
-
String
$table: the table name
-
Array
$array: the array to be checked
-
Array
$fields: what fields to be checked
-
String
$id_field: id field name
Redefined in descendants as:
Returns the names of the available dbs
Mixed
getDBs
()
Redefined in descendants as:
Returns the db type identifier
String
getDbType
()
Redefined in descendants as:
return id string
Mixed
getIdentifier
()
Redefined in descendants as:
Returns the id of the last insert operation
Mixed
getInsertId
()
Redefined in descendants as:
Returns the resulting table but uses the $key field as an index
Mixed
getMapped
(String $key)
-
String
$key: the index key
Redefined in descendants as:
Returns the next row in an array
Mixed
getNext
([Integer $resultType = ANYDB_PREDEFINED_VALUE])
-
Integer
$resultType: should the array have numeric, associative keys, or both
Redefined in descendants as:
Returns the table names of the current db
Mixed
getTables
()
Redefined in descendants as:
Returns a single value after an apropriate sql statement
Mixed
getValue
([mixed $resultType = ANYDB_STRING])
Redefined in descendants as:
Returns the current version
Integer
getVersion
()
Redefined in descendants as:
Returns how many rows are in the result set
Mixed
numRows
()
Redefined in descendants as:
Submits an sql statement to the db
Boolean
query
(mixed $query, String $query
)
Redefined in descendants as:
Changes the current database
Boolean
setDB
()
Redefined in descendants as:
Inherited Methods
Inherited From UtilityClass
UtilityClass::UtilityClass()