Subclass of tgcSqlBuilder that helps to create UPDATE sql-statements.
Subclass of tgcSqlBuilder that helps to create UPDATE sql-statements.
Located in /tgcSqlBuilder/Update.php (line 31)
tgcSqlBuilder | --tgcSqlBuilder_Update
Constructor
Constructor
Add a raw UPDATE statement
Add a raw UPDATE statement There are two ways of calling this method:
1 // simple method-call
2 $sql = new tgcSqlBuilder_Update($dbc);
3 $sql->addUpdate('creationTime', 'NOW()');
4
5 // complex method-call, you can add more than one insert with only one method-call
6 $update = array (
7 'created' => 'NOW()',
8 'changed' => 'NOW()'
9 );
10 $sql->addUpdate($update);
Add a raw WHERE statement.
Add a raw WHERE statement. You can add a raw WHERE statement and define a logical operator. As default this is the logical AND.
Add the statements table.
Add the statements table. If you call this method twice, the tablename that was set in first call will be overwritten.
1 $sql = new tgcSqlBuilder_Update($dbc);
2 $sql->addTable('users');
3
Add a value to update.
Add a value to update. There are two ways of calling this method:
1 // simple method-call
2 $sql = new tgcSqlBuilder_Update($dbc);
3 $sql->addUpdate('col_Username', 'superman');
4
5 // complex method-call, you can add more than one update with only one method-call
6 $update = array (
7 'col_Username' => 'superman',
8 'col_Email' => 'superman@superheroes.com'
9 );
10 $sql->addUpdate($update);
Add a WHERE statement.
Add a WHERE statement. Possible comparison operators are: SQLBUILDER_COMP_EQUAL, SQLBUILDER_COMP_NOT_EQUAL, SQLBUILDER_COMP_LESSER_THAN, SQLBUILDER_COMP_LESSER_EQUAL, SQLBUILDER_COMP_GREATER_EQUAL, SQLBUILDER_COMP_GREATER_THAN, SQLBUILDER_COMP_STARTSWITH, SQLBUILDER_COMP_CONTAINS, SQLBUILDER_COMP_ENDSWITH, SQLBUILDER_COMP_BETWEEN If none is specified then SQLBUILDER_COMP_EQUAL will be used. Possible logical expressions are: SQLBUILDER_LOGICAL_AND, SQLBUILDER_LOGICAL_OR If none is specified, then SQLBUILDER_LOGICAL_AND will be used. When you are using SQLBUILDER_COMP_BETWEEN, then specify $values as a numerical array with two values in correct order.
Generate the sql-statement.
Generate the sql-statement. This method generates a query based on the object-information and returns it as a string.
1 $sql = new tgcSqlBuilder_Update($dbc);
2 $query = $sql->generateQuery();
Remove one or all UPDATE columns.
Remove one or all UPDATE columns. If you specify a columnname, then just this column's UPDATE will be removed, else all UPDATEs will be removed.
Remove the raw WHERE statements, that have been stored so far.
Remove the raw WHERE statements, that have been stored so far.
Remove the tablename.
Remove the tablename.
Remove one or all update columns.
Remove one or all update columns. If you specify a columnname, then just this column's update will be removed, else all updates will be removed.
Remove a WHERE statement.
Remove a WHERE statement. If you don't specify any parameter, then all WHERE information will be removed. If you specify a tablename and a columnname, then this specific ORDER BY setting will be removed.
Reset the object's whole information.
Reset the object's whole information.
Set the LIMIT for the sql-statement.
Set the LIMIT for the sql-statement.
Remove the LIMIT for the sql-statement.
Remove the LIMIT for the sql-statement.
Inherited From tgcSqlBuilder
tgcSqlBuilder::tgcSqlBuilder()
tgcSqlBuilder::addTable()
tgcSqlBuilder::escape()
tgcSqlBuilder::generateQuery()
tgcSqlBuilder::removeTable()
tgcSqlBuilder::reset()
Documentation generated on Fri, 19 Nov 2004 23:54:06 +0100 by phpDocumentor 1.2.3