Public Method Details |
Bs_MsSql |
|
public void Bs_MsSql( )
|
| |
Constructor.
|
| Returns |
void |
|
autoCommit |
|
public void autoCommit( [ string $on ] )
|
| |
Turn autoCommit on or off
Warning: documentation is missing.
|
| Parameter |
|
| string |
$on |
= >>FALSE<< |
|
(opt) If TRUE turn on else off (default TRUE) |
|
| Returns |
void |
| Throws |
Bs_Exception if not supported by this DB |
|
startTransaction |
|
public void startTransaction( [ string $transactionId ] )
|
| |
Starts a transaction
As optional parameter you can pass a transaction ID.When working with transactions, I run often in the situation, that I have a 'Master' routine callingother sub-routines and some sub-routines start their own transation. Multiple transaction 'starts'don't bother the Db, the transaction just stays open *BUT* the first to call commit or rollback willterminate the transaction! To prevent sub-routines from closing the 'Masters' transaction you maystart a transaction and pass a 'transaction ID'. Folloing commits/rollbacks are ignored as long as itdosen't match the 'transaction ID' given at start.NOTE I: Be aware of the highter deadlocking risk, when using 'transaction ID'.NOTE II: Make sure that you end the open transaction when using 'transaction ID'.Otherwise the transaction will *stay open*.
Warning: documentation is missing.
|
| Parameter |
|
| string |
$transactionId |
= >>''<< |
|
(opt). See text above. |
|
| Returns |
void |
| Throws |
Bs_Exception if not supported by this DB or on any other error. |
|
commit |
|
public void commit( [ string $transactionId ] )
|
| |
Commit the current or given transaction.
Warning: documentation is missing.
|
| Parameter |
|
| string |
$transactionId |
= >>''<< |
|
(opt). See $this->startTransaction. |
|
| Returns |
void |
| Throws |
Bs_Exception if not supported by this DB or on any other error. |
|
rollback |
|
public void rollback( [ string $transactionId ] )
|
| |
Rollback last query
Warning: documentation is missing.
|
| Parameter |
|
| string |
$transactionId |
= >>''<< |
|
(opt). See $this->startTransaction. |
|
| Returns |
void |
| Throws |
Bs_Exception if not supported by this DB or on any other error. |
|
connect |
|
public int connect( array $dsn, string $persistent )
|
| |
Connect to a database server and log in as the specified user.
use (select) the given db, if any.NOTE I: If we are already connected to somewhere (no matter where),the existing db connection gets closed first.NOTE II: It's possible to get back an exception but the connection was successfull.Probably the given default database could not be selected => BS_DB_ERROR_CANNOT_SELECT_DB
|
| Parameter |
|
| array |
$dsn |
|
|
. The parseDSN() is deactivated, would need cleanup. |
|
|
| string |
$persistent |
|
|
Warning: documentation is missing. |
|
| Returns |
int resource id # on success |
| Throws |
Bs_Exception: one of BS_DB_ERROR_INVALID_DSN, BS_DB_ERROR_CONNECT_FAILED, BS_DB_ERROR_CANNOT_SELECT_DB |
|
disconnect |
|
public bool disconnect( )
|
| |
Log out and disconnect from the database.
Note: mssql_close() will not close persistent links (created by mssql_pconnect()).
|
| Returns |
bool TRUE if we already have been or are now disconnected, FALSE if we're on a persistant conn. |
| Throws |
NULL if we cannot tell in which state the connection is now. internally for this object, the connection is 'closed'. |
|
selectDb |
|
public bool selectDb( string $db )
|
| |
Select a MsSQL database.
this is a wrapper for mssql_select_db().
|
| Parameter |
|
| string |
$db |
|
|
a database name. |
|
| Returns |
bool true on success, false on failure. |
|
&fetchRow |
|
public mixed &fetchRow( int $result, string $fetchMode )
|
| |
Fetch a row and return it as vector or hash depending on the fetchMode.
Subsequent calls will return the next row in the result set, or NULL if there are no more rows.If fetchMode is BS_DB_FETCHMODE_ASSOC (default), it returns a hash array that correspondsto the fetched row else if it's BS_DB_FETCHMODE_ORDERED returns a vector starting at offset 0.A clean example usage of this method to fetch rows into an array:while ($row = $this->fetchRow($res, $fetchMode)) {if ($this->isException($row)) {$row->stackTrace('was here: currentFunction()', __FILE__, __LINE__);return $row;}$ret[] = $row;}
|
| Parameter |
|
| int |
$result |
|
|
(opt) (default BS_DB_FETCHMODE_ASSOC) see above. |
|
|
| string |
$fetchMode |
|
|
Warning: documentation is missing. |
|
| Returns |
mixed vector , hash or NULL if there is no more data |
| Throws |
Bs_Exception on error. |
|
numCols |
|
public int numCols( $result )
|
| |
Get the number of columns (fields) from a result set.
Warning: documentation is missing.
|
| Parameter |
|
|
$result |
|
|
Warning: documentation is missing. |
|
| Returns |
int the number of columns per row in $result |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception if mssql_num_fields() failed somehow |
|
numRows |
|
public int numRows( $result )
|
| |
Get the number of rows from a result set.
Warning: documentation is missing.
|
| Parameter |
|
|
$result |
|
|
Warning: documentation is missing. |
|
| Returns |
int the number of rows in $result |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception if mssql_num_rows() failed somehow. |
|
affectedRows |
|
public int affectedRows( )
|
| |
Gets the number of rows affected by the data manipulation query.
For other queries, this function returns FALSE.RTFM for mysql_affected_rows() !!!If the last query was a DELETE query with no WHERE clause, all of the recordswill have been deleted from the table but this function will return zero.hint I: use "DELETE FROM tbl WHERE 1=1"hint II: maybe you are looking for "TRUNCATE TABLE table_name" anyway.
Warning: documentation is missing.
|
| Returns |
int number of rows affected by the last query or FALSE none affected |
| Throws |
Bs_Exception if mssql_affected_rows() fails. |
|
insertId |
|
public int insertId( )
|
| |
Returns the ID generated for an AUTO_INCREMENT column by the previous INSERT query on this thread.
Returns 0 if the previous query does not generate an AUTO_INCREMENT value.If you need to save the value for later, be sure to call this function immediately after the querythat generates the value.This method is save, thanks to rick@surveyor.com for the information :)
Warning: documentation is missing.
|
| Returns |
int A value>=1 (the ID) or 0 (no AUTO_INCREMENT value given) or FLASE (see above) |
| Throws |
Bs_Exception if not supported by this DB or any other error. |
|
freeResult |
|
public void freeResult( $result )
|
| |
Free the internal resources associated with $result. Only needs to be called if you are
concerned about how much memory is being used for queries that return large result sets.All associated result memory is automatically freed at the end of the script's execution.
Warning: documentation is missing.
|
| Parameter |
|
|
$result |
|
|
Warning: documentation is missing. |
|
| Returns |
void |
|
fieldName |
|
public string fieldName( int $result, $offset )
|
| |
Get the field name at the specified offset from a result id.
This is a wrapper for mssql_field_name().
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
|
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
string the field name |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception on a field index that doesn't exist or any other error. |
| See Also |
tableName(), databaseName(), listFields() |
|
tableName |
|
public string tableName( int $result, $offset )
|
| |
Returns the name of the table that the field (specifed by an offset) is in.
This is a wrapper for mysql_field_table().
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
|
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
string the table name |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception on a field index that doesn't exist or any other error. |
| See Also |
fieldName(), databaseName(), listTables() |
|
tableName2 |
|
public string tableName2( int $result, $offset )
|
| |
Get the name of the specified table in a result you got from mysql_list_tables().
This is a wrapper for mysql_tablename().
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
|
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
string the table name
@throw bs_exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, bs_exception on a field index that doesn't exist or any other error. |
| See Also |
fieldName(), tableName(), databaseName(), listTables() |
|
databaseName |
|
public string databaseName( int $result, $offset )
|
| |
Get the name of the specified db in a result you got from mysql_list_dbs().
This is a wrapper for mysql_db_name().I don't think you ever need this method ...
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
|
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
string the db name |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception on a field index that doesn't exist or any other error. |
| See Also |
fieldName(), tableName(), listDatabases() |
|
fieldLen |
|
public int fieldLen( int $result, $offset )
|
| |
Returns the length of a field at the specified offset from a result id.
NOTE: Not the actual value length but the max possible field space:E.g. if a varchar(20) has the value 'foobar' it returns 20 not 6.This is a wrapper for mysql_field_len() AND mysql_fieldlen() .
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
|
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
int the field length. |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception on a field index that doesn't exist or any other error. |
|
fieldFlags |
|
public mixed fieldFlags( int $result, string $offset, string $format )
|
| |
Get the flags of a field at the specified offset from a result id.
This is a wrapper for mysql_field_flags().The returned value is dependent on the $format param. E.g.:'string' => 'not_null primary_key blob''vector' => array('not_null', 'primary_key', 'blob')'hash' => array('not_null' => TRUE, 'primary_key' => TRUE, 'unique_key' => FALSE, ...)Please check the docs for mysql_field_flags to get a list of the current flags supported.By now, they are: (***IF THEY HAVE CHANGED, PLEASE UPDATE THE CODE OF THIS METHOD!***)"not_null", "primary_key", "unique_key", "multiple_key", "blob", "unsigned", "zerofill","binary", "enum", "auto_increment", "timestamp".I have read somewhere that the 'flags' blob, enum and timestamp are deprecated because theyare not flags but field types. You're descouraged to use them.
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
| string |
$offset |
|
|
the return type, can be 'string', 'array' or 'assoc'. |
|
|
| string |
$format |
|
|
Warning: documentation is missing. |
|
| Returns |
mixed (based on the param $format) see description. |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception on a field index that doesn't exist or any other error. |
|
hasFieldFlag |
|
public boolean hasFieldFlag( int $result, string $offset, $flag )
|
| |
Tells whether the field has the given flag. The field is specified by offset in a result id.
This method uses $this->fieldFlags() to get the data. Check it's documentation!
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. |
|
|
| string |
$offset |
|
|
the flag name. |
|
|
|
$flag |
|
|
Warning: documentation is missing. |
|
| Returns |
boolean |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, NULL if the flag is not known. maybe not supported in this mysql version... |
|
fieldType |
|
public string fieldType( int $result, integer $offset )
|
| |
Get the type of a field at the specified offset from a result id.
This is a wrapper for mssql_field_type().--------------------------------------------------------------------------CAUTION: mysql used to return wrong names. maybe mssql does the same?please verify. (from mysql:)+----------------------------+| mysql type | returned as |+ ------------+--------------+| tinyint | int | // php4.0.4pl1 used to return unknown. Corrected in php4.0.5| smallint | int || mediumint | int || int | int || bigint | int || float | real || double | real || decimal | real || date | date || datetime | datetime || timestamp | timestamp || year | year | // php4.0.4pl1 used to return unknown. Corrected in php4.0.5| char | string || varchar | string || tinyblob | blob || blob | blob || mediumblob | blob || longblob | blob || enum | string || set | string |+----------------------------+--------------------------------------------------------------------------
|
| Parameter |
|
| int |
$result |
|
|
fieled offset in result beginning with 0. default is 0. |
|
|
| integer |
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
string |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception on a field index that doesn't exist or any other error. |
|
listDatabases |
|
public void listDatabases( )
|
| |
returns a result identifier for the available databases.
note I: with mssql you see all db's even if you have no access to them. that may be different in other rdbms.
|
| Returns |
void |
| Throws |
Bs_Exception. |
| See Also |
listFields(), listTables() |
|
listTables |
|
public void listTables( [ string $dbName ] )
|
| |
returns a result identifier for the available tables in the given database.
note I: tables may exist but if you don't have the perms, you won't see them!note II: only 'U'ser tables will be listed. no 'S'ystem stuff.
|
| Parameter |
|
| string |
$dbName |
= >>NULL<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
| Returns |
void |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception if something fails. |
| See Also |
listFields(), listDatabases() |
|
listFields |
|
public void listFields( string $tableName, [ string $dbName ] )
|
| |
Retrieves information about the given tablename.
This is a wrapper for mysql_list_fields().NOTE: Fields may exist but if you don't have the perms, you won't see them!
Warning: documentation is missing.
|
| Parameter |
|
| string |
$tableName |
|
|
the db table name. |
|
|
| string |
$dbName |
= >>NULL<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
| Returns |
void |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception if mysql_list_fields() failed somehow. |
| See Also |
listTables(), listDatabases() |
|
&fetchDatabaseNames |
|
public mixed &fetchDatabaseNames( [ string $format, string $useCache ] )
|
| |
Returns the available db names.
If successfull the data will be cached for further calls.NOTE: You'll see all db's even if you don't have the rights to access them.The returned value is dependent on the $format param. E.g.:'vector' => array(db1, db2, db3)'string' => 'db1, db2, db3'
|
| Parameter |
|
| string |
$format |
= >>'vector'<< |
|
the return type. can be one of 'vector' (default) or 'string'. see description. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
default is TRUE. if set to true and the method has been executed successfully before, the previous result will be used/returned. |
|
| Returns |
mixed (see param $format) |
| See Also |
listDatabases() |
|
&fetchTableNames |
|
public mixed &fetchTableNames( [ string $dbName, string $format, string $useCache ] )
|
| |
Return the table names of the given database.
If successfull the data will be cached for further calls.NOTE: Tables may exist but if you don't have the perms, you won't see them!The returned value is dependent on the $format param. E.g.:'vector' => array(table1, table2, table3)'string' => 'table1, table2, table3'
|
| Parameter |
|
| string |
$dbName |
= >>NULL,<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
|
| string |
$format |
= >>'vector'<< |
|
the return type. can be one of 'vector' (default) or 'string'. see description. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
default is TRUE. if set to true and the method has been executed successfully before for this db, the previous result will be used/returned. |
|
| Returns |
mixed (see param $format) |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
| See Also |
getOpenTables() |
|
&fetchFieldNames |
|
public mixed &fetchFieldNames( string $tblName, [ string $dbName, string $format, string $useCache ] )
|
| |
Return the field names of the given database table.
If successfull the data will be cached for succeeding calls.NOTE: Fields may exist but if you don't have the perms, you may not see them!(that's how mysql is built, not sure about mssql.)The returned value is dependent on the $format param. E.g.:'vector' => array(field1, field2, field3)'string' => 'field1, field2, field3' we are using comma instead of space here becausesome db's allow you to use spaces inside of field names.
|
| Parameter |
|
| string |
$tblName |
|
|
a db table name |
|
|
| string |
$dbName |
= >>NULL,<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
|
| string |
$format |
= >>'vector'<< |
|
the return type. Can be one of 'vector' (default) or 'string'. see description. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
If TRUE (default) and the method has been executed successfully before for this db table, the previous result will be used/returned. |
|
| Returns |
mixed (see param $format) |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
|
&getDbStructure |
|
public void &getDbStructure( [ string $dbName, string $useCache ] )
|
| |
Return a 2-D array of tables and fieldnames found in the given db.
If successfull the data will be cached for succeeding calls.NOTE: Tables and fields may exist but if you don't have the perms, you won't see them!The returned value sample:array( 'table_1' => array('field_1', 'field_2', 'field_3'),'table_2' => array('field_A', 'field_B', 'field_C', 'field_D'));
|
| Parameter |
|
| string |
$dbName |
= >>NULL,<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
If TRUE (default) and the method has been executed successfully before for this db table, the previous result will be returned. |
|
| Returns |
void |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
|
fetchField |
|
public object [unknown] fetchField( int $result, string $offset )
|
| |
Returns an object containing field information (of the table structure).
This has nothing to do with fetching data from a field, like fetchRow().You might be looking for something like php's mssql_result(), which is notsupported here for reasons mentioned in the header.See comments of unimplemented functions in the head of this file.This is a wrapper for mssql_fetch_field().
|
| Parameter |
|
| int |
$result |
|
|
if not given, the next field (that wasn't yet retrieved) will be used. |
|
|
| string |
$offset |
|
|
Warning: documentation is missing. |
|
| Returns |
object [unknown] |
| Throws |
Bs_Exception with BS_DB_ERROR_INVALID_RS on an invalid $result param, Bs_Exception if mssql_fetch_field() failed somehow. |
|
fieldExists |
|
public bool fieldExists( mixed $fieldName, string $tableName, [ string $dbName, string $useCache ] )
|
| |
Tells whether the db field (or fields) exist or not.
NOTE I: Fields are not case sensitive in mysql (dbs and tables are, except on windows).This check is made case sensitive! So if your field is called 'myField',you'll get FALSE for 'myfield'.NOTE II: This method makes use of fetchFieldNames(). So if param $useCache is set to TRUE andfetchFieldNames() has been called before, the cached values will be used.
|
| Parameter |
|
| mixed |
$fieldName |
|
|
a db field name as a string, or an array with db field names. |
|
|
| string |
$tableName |
|
|
a db table name |
|
|
| string |
$dbName |
= >>NULL,<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
default is TRUE. see note II. |
|
| Returns |
bool true if all fields exist, false if at least one doesn't. |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
| See Also |
tableExists(), databaseExists() |
|
tableExists |
|
public bool tableExists( mixed $tableName, [ string $dbName, string $useCache ] )
|
| |
Tells whether the db table (or tables) exist or not.
NOTE I: Databases and tables are file-based in mysql. So they are case sensitive, except on winblows.So for windows we have to do a case insensitive check.NOTE II: This method makes use of fetchTableNames(). So if param $useCache is set to TRUE andfetchTableNames() has been called before, the cached values will be used.
|
| Parameter |
|
| mixed |
$tableName |
|
|
a db table name as a string, or an array with db table names. |
|
|
| string |
$dbName |
= >>NULL,<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
default is TRUE. see note II. |
|
| Returns |
bool true if all tables exist, false if at least one doesn't. |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
| See Also |
fieldExists(), databaseExists() |
|
databaseExists |
|
public bool databaseExists( mixed $dbName, [ string $useCache ] )
|
| |
Tells whether the database (or databases) exist or not.
NOTE I: Databases and tables are file-based in mysql. So they are case sensitive, except on winblows.So for windows we have to do a case insensitive check.NOTE II: This method makes use of fetchDatabaseNames(). So if param $useCache is set to TRUE andfetchDatabaseNames() has been called before, the cached values will be used.
|
| Parameter |
|
| mixed |
$dbName |
|
|
a db name as a string, or an array with db names. |
|
|
| string |
$useCache |
= >>TRUE<< |
|
default is TRUE. see note II. |
|
| Returns |
bool true if all dbs exists, false if at least one doesn't. |
| Throws |
Bs_Exception |
| See Also |
fieldExists(), tableExists() |
|
getTableInfo |
|
public array getTableInfo( string $tblName, [ string $dbName ] )
|
| |
Returns an hash holding information about the given db table.
The returned hash (for mySQL 3.23.36) returns these 15 keys (values are examples):mysql> show table status like 'test';+------+--------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+----------------+---------+| Name | Type | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Create_options | Comment |+------+--------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+----------------+---------+| test | MyISAM | Dynamic | 4 | 22 | 88 | 4294967295 | 2048 | 0 | 5 | 2001-04-02 09:06:58 | 2001-04-02 09:07:00 | NULL | | |+------+--------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+----------------+---------+
|
| Parameter |
|
| string |
$tblName |
|
|
a db table name |
|
|
| string |
$dbName |
= >>NULL<< |
|
. If empty (e.g: '' or NULL or 0) then use the current dbName. |
|
| Returns |
array assoc . array see description. |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
| See Also |
tableHasTransactions(), getTableType() |
|
getTableType |
|
public string getTableType( string $tblName, [ string $dbName ] )
|
| |
Returns the table type of the specified db table.
|
| Parameter |
|
| string |
$tblName |
|
|
a db table name |
|
|
| string |
$dbName |
= >>NULL<< |
|
a db name, default is NULL which means use the current one. |
|
| Returns |
string the table type, currently one of 'MyISAM', 'ISAM', 'MERGE', 'HEAP', 'BDB', 'INNOBASE', 'GEMINI' |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
| See Also |
tableHasTransactions(), getTableInfo(), serverSupportsTableType() |
|
tableHasTransactions |
|
public bool tableHasTransactions( string $tblName, [ string $dbName ] )
|
| |
|
| Parameter |
|
| string |
$tblName |
|
|
a db table name |
|
|
| string |
$dbName |
= >>NULL<< |
|
a db name, default is NULL which means use the current one. |
|
| Returns |
bool true if table supports transactions, false otherwise. |
| Throws |
Bs_Exception with BS_DB_ERROR_NEED_MORE_DATA if no $dbName available, Bs_Exception otherwise. |
| See Also |
getTableType(), getTableInfo() |
|
serverSupportsTableType |
|
public bool serverSupportsTableType( string $tableType )
|
| |
Tells whether the given table type is supported by the server or not.
NOTE: 'MyISAM', 'MERGE' and 'HEAP' are always supported. But if you still check for them, of courseTRUE is returned.The default mysql table type currently is MyISAM according to the manual. If you try to create onethat's not supported or not compiled into the server, a MyISAM table will be created instead. ISAMis deprecated, it is replaced by MyISAM. BDB, INNOBASE and GEMINI are transaction-safe, the othersare not.hrm. i've found an ini var called 'table_type' with the value 'MYISAM'. Prolly you can change thedefault table type there.
|
| Parameter |
|
| string |
$tableType |
|
|
one of 'MyISAM', 'ISAM', 'MERGE', 'HEAP', 'BDB', 'INNOBASE', 'GEMINI' (case doesn't matter). |
|
| Returns |
bool true if the table type is supported, false otherwise. |
| Throws |
NULL if the given table type is not recognized, Bs_Exception otherwise. |
| See Also |
getTableType(), tableHasTransactions(), getTableInfo() |
|
getIniVar |
|
public mixed getIniVar( [ string $key, string $useCache ] )
|
| |
Return the value of the currently used ini setting var.
as of mySQL 3.23.36, the following 76 vars are available (with example values):+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Variable_name | Value |+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| ansi_mode | OFF || back_log | 50 || basedir | c:\mysql\ || binlog_cache_size | 32768 || character_set | latin1 || character_sets | latin1 big5 czech euc_kr gb2312 gbk sjis tis620 ujis dec8 dos german1 hp8 koi8_ru latin2 swe7 usa7 cp1251 danish hebrew win1251 estonia hungarian koi8_ukr win1251ukr greek win1250 croat cp1257 latin5 || concurrent_insert | ON || connect_timeout | 5 || datadir | c:\mysql\data\ || delay_key_write | ON || delayed_insert_limit | 100 || delayed_insert_timeout | 300 || delayed_queue_size | 1000 || flush | OFF || flush_time | 1800 || have_bdb | NO || have_gemini | NO || have_innobase | NO || have_isam | YES || have_raid | NO || have_ssl | NO || init_file | || interactive_timeout | 28800 || join_buffer_size | 131072 || key_buffer_size | 8388600 || language | c:\mysql\share\english\ || large_files_support | ON || log | OFF || log_update | OFF || log_bin | OFF || log_slave_updates | OFF || long_query_time | 10 || low_priority_updates | OFF || lower_case_table_names | 1 || max_allowed_packet | 1048576 || max_binlog_cache_size | 4294967295 || max_binlog_size | 1073741824 || max_connections | 100 || max_connect_errors | 10 || max_delayed_threads | 20 || max_heap_table_size | 16777216 || max_join_size | 4294967295 || max_sort_length | 1024 || max_user_connections | 0 || max_tmp_tables | 32 || max_write_lock_count | 4294967295 || myisam_recover_options | OFF || myisam_sort_buffer_size | 8388608 || net_buffer_length | 16384 || net_read_timeout | 30 || net_retry_count | 10 || net_write_timeout | 60 || open_files_limit | 0 || pid_file | c:\mysql\data\workstation.pid || port | 3306 || protocol_version | 10 || record_buffer | 131072 || query_buffer_size | 0 || safe_show_database | OFF || server_id | 0 || skip_locking | ON || skip_networking | OFF || skip_show_database | OFF || slow_launch_time | 2 || socket | MySQL || sort_buffer | 2097144 || table_cache | 64 || table_type | MYISAM || thread_cache_size | 0 || thread_stack | 65536 || transaction_isolation | READ-COMMITTED || timezone | Westeuropõische Sommerzeit || tmp_table_size | 1048576 || tmpdir | \ || version | 3.23.36 || wait_timeout | 28800 |+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+timezone:i have seen the following values'CEST''W. Europe Daylight Time''Westeuropõische Sommerzeit' i think that the 'õ' was a 'ä' in the database but was spitted outincorrectly in my telnet session.this makes it hard to find out the used timezone. not for a human, but for a peace of code.this method uses the 'SHOW VARIABLES' syntax.
|
| Parameter |
|
| string |
$key |
= >>NULL,<< |
|
the key (name) of the var you want the value. not case sensitive. if not set or set to NULL, an associative array holding all keys/values will be returned. |
|
|
|