Class: MySQLDatabaseTable
Source Location: /databases/mysql/MySQLDatabaseTable.class.php
ABSTDatabaseTable
|
--MySQLDatabaseTable
Author(s):
Version:
Copyright:
Copyright (C) 2004 Daniel Plücken <daniel@debakel.net> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Methods
constructor MySQLDatabaseTable [line 74]
Constructor
Tags:
Parameters:
method copyTable [line 383]
boolean copyTable(
string
$newTableName, [string
$targetDatabase = ""])
|
|
Copies this table.
Tags:
Parameters:
method delete [line 1240]
boolean delete(
string
$where)
|
|
Deletes the specified dataset.
Tags:
Parameters:
method doCSVImport [line 110]
boolean doCSVImport(
CSVFiles
$csv_file_obj, [array
$field_arr = ""])
|
|
Iports data from a csv file. You have to create a CSVFiles-Object first.
Tags:
Parameters:
method echoBufferedDump [line 505]
string echoBufferedDump(
[string
$newTableName = ""], [boolean
$full_inserts = false], [boolean
$drop_order = false], [boolean
$if_not_exists_order = false], [string
$where = ""], [integer
$flush_row_count = 1000])
|
|
Returns an SQL-DUMP.
Tags:
Parameters:
method emptyTable [line 419]
method getArrayOfDataField [line 1101]
mixed getArrayOfDataField(
string
$fieldname, string
$where)
|
|
Returns a array of values of a data field.
Tags:
Parameters:
method getAutoIncrementField [line 218]
string getAutoIncrementField(
)
|
|
Returns the fieldname of the auto increment field if there is one.
Tags:
method getCount [line 657]
integer getCount(
[string
$where = ""])
|
|
Returns the count of the fields in the where clause.
Tags:
Parameters:
method getCreateOrder [line 254]
string getCreateOrder(
[string
$newTableName = ""], [boolean
$drop_order = false], [boolean
$if_not_exists_order = false])
|
|
Returns an SQL-string to create this table. You can give a new name for creating the table.
Tags:
Parameters:
method getDataOrder [line 309]
string getDataOrder(
[string
$newTableName = ""], [boolean
$full_inserts = false], [string
$where = ""])
|
|
Returns an SQL-string to fill this table. You can give a new name for the table to insert in.
Tags:
Parameters:
method getDatasets [line 837]
array getDatasets(
[string
$fields_or_where = "1=1"], [boolean
$where_or_only_one = false], [string
$array_kind = MYSQL_OUTPUT_DEFAULT], [boolean
$only_one = false])
|
|
This method is an alias for the method "getDatasetsWithFields". Returns the datasets as an two dimensional array if the query could be execute. The first dimension carries the datasets. The second dimension carries the fields's values of the result list. Usage: getDatasets( $fieldnamesArr, $where, $array_kind ); Or: getDatasets( $where );
Tags:
Parameters:
method getDatasetsWithFields [line 708]
array getDatasetsWithFields(
[array
$field_arr = array()], [string
$where = "1=1"], [string
$only_one = false], [string
$array_kind = MYSQL_OUTPUT_DEFAULT])
|
|
Returns the datasets as an two dimensional array if the query could be execute. The first dimension carries the datasets. The second dimension carries the fields's values of the result list. Usage: getDatasetsWithFields( $fieldnamesArr, $where ); Or: getDatasetsWithFields( $where, $array_kind ); Or: getDatasetsWithFields( $where );
Tags:
Parameters:
method getDatasetsWithPrimaryToMultiple [line 955]
array getDatasetsWithPrimaryToMultiple(
array
$primary_key, array
$value_fields, [string
$where = null])
|
|
Returns the datasets as array with the values of the primary key as index.
Tags:
Parameters:
method getDatasetsWithPrimaryToValue [line 891]
array getDatasetsWithPrimaryToValue(
array
$primary_key, array
$value_fields, [string
$where = null])
|
|
Returns the datasets as array with the values of the primary key as index.
Tags:
Parameters:
method getDump [line 472]
string getDump(
[string
$newTableName = ""], [boolean
$full_inserts = false], [boolean
$drop_order = false], [boolean
$if_not_exists_order = false])
|
|
Returns an SQL-DUMP.
Tags:
Parameters:
method getFieldnames [line 1507]
array getFieldnames(
[boolean
$backticks = false])
|
|
Returns the table's fieldnames. If you want you can get the fieldnames enclosed in backticks.
Tags:
Overrides ABSTDatabaseTable::getFieldnames() (Returns the table's fieldnames.)
Parameters:
method getMaxOf [line 590]
integer getMaxOf(
string
$fieldname, [string
$where = ""])
|
|
Returns the maximum value from a field.
Tags:
Parameters:
method getMinOf [line 556]
integer getMinOf(
string
$fieldname, [string
$where = ""])
|
|
Returns the minimum value from a field.
Tags:
Parameters:
method getPrimaryKey [line 183]
array|false &getPrimaryKey(
)
|
|
Returns all field members of the primary key of this database table.
Tags:
Overrides ABSTDatabaseTable::getPrimaryKey() (This method has to be implement in a subclass!)
method getRealFieldnames [line 1466]
array getRealFieldnames(
[boolean
$backticks = false])
|
|
Returns the table's fieldnames independence of overruled fieldnames. If you want you can get the fieldnames enclosed in backticks.
Tags:
Parameters:
method getSingleDataFieldValue [line 1072]
mixed getSingleDataFieldValue(
string
$fieldname, string
$where)
|
|
Returns a single value of a data field.
Tags:
Parameters:
method getSingleDataset [line 1027]
array getSingleDataset(
string
$fields_or_where, [string
$where = ""], [string
$array_kind = MYSQL_OUTPUT_DEFAULT])
|
|
Returns a single dataset as an array if the query could be execute.
Tags:
Parameters:
method getSumOf [line 624]
integer getSumOf(
string
$fieldname, [string
$where = ""])
|
|
Returns the sum value of a field.
Tags:
Parameters:
method insert [line 1276]
boolean insert(
array
$fieldArr, array
$valueArr)
|
|
Inserts the specified dataset. Note that this function will create a global variable $GLOBALS["insert_id"] which contains the result of mysql_insert_id();
Tags:
Parameters:
method overruleFieldnames [line 1539]
void overruleFieldnames(
array
$array)
|
|
Overrules the table's fieldnames. The given array should contain the comma separated list of the query between the keywords SELECT and FROM. Each element of the array should represent one element of the list.
Tags:
Parameters:
method probeConnection [line 1578]
boolean probeConnection(
)
|
|
Probes whether there is a connection to the databasehost, if not it will attempt to connect to the host.
Tags:
method putSingleDatasetIntoGetVars [line 1223]
void putSingleDatasetIntoGetVars(
string|array
$where_or_field_arr, [string
$where = ""])
|
|
Puts a single dataset into "get"-variables. The names of the "get"-vars accord to the fieldnames of the Databasetable.
Tags:
Parameters:
method putSingleDatasetIntoPostVars [line 1203]
void putSingleDatasetIntoPostVars(
string|array
$where_or_field_arr, [string
$where = ""])
|
|
Puts a single dataset into "post"-variables. The names of the "Post"-vars accord to the fieldnames of the Databasetable.
Tags:
Parameters:
method putSingleDatasetIntoRequestVars [line 1153]
void putSingleDatasetIntoRequestVars(
string|array
$where_or_field_arr, [string
$where = ""], [array
$request_type_arr = array( "GET", "POST", "REQUEST" )])
|
|
Puts a single dataset into request-variables. The names of the request-vars accord to the fieldnames of the Databasetable. You can fill variables of the types: $_REQUEST, $_GET and $_POST. You only have to list them in an array passed as third parameter in this function (see the description for third parameter).
Tags:
Parameters:
method renameTable [line 443]
boolean renameTable(
string
$newTableName)
|
|
Renames this table.
Tags:
Parameters:
method replace [line 1359]
boolean replace(
array
$fieldArr, array
$valueArr)
|
|
Replaces the specified dataset.
Tags:
Parameters:
method researchFields [line 88]
method storeFieldFlags [line 143]
Stores the Flags: (!)not_null <=> $this->field_can_be_null[FIELDINDEX], primary_key <=> $this->field_is_primary_member[FIELDINDEX], auto_increment <=> $this->field_has_auto_increment[FIELDINDEX]. This is necessary to get dump of the table data.
Tags:
method storeFieldnames [line 1423]
boolean storeFieldnames(
)
|
|
Stores the names of fields in this object.
Tags:
method swapFieldValuesOf [line 1402]
boolean swapFieldValuesOf(
string
$fieldname, string
$where_a, string
$where_b)
|
|
Swaps values of a specified field in two tupel.
Tags:
Parameters:
method unsetOverruledFieldnames [line 1557]
void unsetOverruledFieldnames(
)
|
|
Unsets the overrules of fieldnames.
Tags:
method update [line 1319]
boolean update(
array
$fieldArr, array
$valueArr, [string
$where = "1=1"])
|
|
Updates the specified dataset.
Tags:
Parameters:
|
|