[line 68]
Provides simple but powerful flatfile database storage and retrieval
Includes equivalents to SELECT * FROM table WHERE..., DELETE WHERE ... UPDATE and more. All files are stored in the $datadir directory, and table names are just filenames in that directory. Subdirectories can be used just by specifying a table name that includes the directory name.
int insertWithAutoId(
string
$tablename, int
$idField, array
$newRow)
Inserts a row with an automatically generated ID
The autogenerated ID will be the highest ID in the column so far plus one. The supplied row should include all fields required for the table, and the ID field it contains will just be ignored
Selects rows from a table that match the specified criteria
This simulates the following SQL query:
SELECT LIMIT $limit * FROM $tablename
WHERE $whereclause
ORDER BY $orderBy [ASC | DESC] [, $orderBy2 ...]
Tags:
return:
The matching data, as an array of rows, where each row is an array of columns
Parameters:
string
$tablename
The table (file) to get the data from
object
$whereClause
Either a WhereClause object to do selection of rows, or NULL to select all
mixed
$limit
Specifies limits for the rows returned:
use -1 or omitted to return all rows
use an integer n to return the first n rows
use a two item array ($startrow, $endrow) to return rows $startrow to $endrow - 1 (zero indexed)
use a two item array ($startrow, -1) to return rows $startrow to the end (zero indexed)
mixed
$orderBy
Either an OrderBy object or an array of them, defining the sorting that should be applied (if an array, then the first object in the array is the first key to sort on etc). Use NULL for no sorting.
Updates fields in a table for rows that match the provided criteria
$newFields can be a complete row or it can be a sparsely populated hashtable of values (where the keys are integers which are the column indexes to update)
Parameters:
string
$tablename
The table to update
array
$newFields
A hashtable (with integer keys) of fields to update