|
||
| [ class tree: core_db ] [ index: core_db ] [ all elements ] | ||
|
Packages: packageless applications_chartwizard applications_cms applications_contactform applications_debedoo applications_faq applications_filebrowser applications_filemanager applications_imagearchive applications_indexedlistmanager applications_mailinglist applications_simplequiz applications_smartshop applications_websearchengine core core_auth core_crypt core_date core_db core_file core_gfx core_html core_lang core_net core_storage core_text core_util core_xml Cpdf plugins_geo plugins_indexserver plugins_instanthelp plugins_jsrs plugins_onomastics toolbox_phppackager _ Files:
Bs_ArrayDb.class.php
Bs_Db.class.php Bs_DbGeneral.lib.php Bs_DbWrapper.class.php Bs_Db_PhpUnit.class.php Bs_MsSql.class.php Bs_MySql.class.php Bs_MySql_PhpUnit.class.php Bs_Oci.class.php Bs_Odbc.class.php Bs_ResultSet.class.php subpackage examples Classes: |
[ Top ] $_currentlyOpenTransactionID = ''[line 182] Holds the 'transaction ID'. (If an trans. ID was set).Tags:
[ Top ] Class Methodsconstructor Bs_MySql [line 220]method affectedRows [line 597]
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 records will 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. Tags:
Overrides Bs_Db::affectedRows() (Gets the number of rows affected by the last data manipulation query.) [ Top ]
method autoCommit [line 248]
Turn autoCommit on or off Tags:
Overrides Bs_Db::autoCommit() (Turn autoCommit on or off) Parameters:
[ Top ]
method commit [line 284]
Commit the current or given transaction. Tags:
Overrides Bs_Db::commit() (Commit last query) Parameters:
[ Top ]
method connect [line 334]
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 Tags:
Parameters:
[ Top ]
method databaseExists [line 1270]
Tells whether the database (or databases) exist or not. NOTE I: Databases and tables are file-based in mysql. So they are case sensitive on iX, *but* INsensitive 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 and fetchDatabaseNames() has been called before, the cached values will be used. Tags:
Parameters:
[ Top ]
method databaseName [line 711]
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 ... Tags:
Parameters:
[ Top ]
method disconnect [line 397]
Log out and disconnect from the database. Tags:
[ Top ]
method escapeString [line 2421]
Escape string for mysql query. This method is a wrapper for mysql_escape_string() and overwrites its parent method. mysql_escape_string() is new sinde php403 or 404 and by now it's not documented. I have found this in the mysql manual: mysql_real_escape_string() Escapes special characters in a string for use in a SQL statement taking into account the current charset of the connection. mysql_escape_string() Escapes special characters in a string for use in a SQL statement. So watch out for mysql_real_escape_string() to be implemented in php... You can find a pure php impelementation here: http://www.zend.com/codex.php?id=204&single=1 Tags:
Overrides Bs_Db::escapeString() (Escape string for the query.) Parameters:
[ Top ]
method fetchDatabaseNames [line 941]
Return 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' Tags:
Parameters:
[ Top ]
method fetchField [line 1151]
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 mysql_result(), which is not supported here for reasons mentioned in the header. See comments of unimplemented functions in the head of this file. This is a wrapper for mysql_fetch_field(). Tags:
Parameters:
[ Top ]
method fetchFieldNames [line 1056]
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 won't see them! 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 because some db's allow you to use spaces inside of field names. Tags:
Parameters:
[ Top ]
method fetchRow [line 525]
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 corresponds to 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 (isEx($row)) { $row->stackTrace('was here: currentFunction()', __FILE__, __LINE__); return $row; } $ret[] = $row; } Tags:
Overrides Bs_Db::fetchRow() (Fetch a row and return it as vector or hash depending on the fetchMode.) Parameters:
[ Top ]
method fetchTableNames [line 996]
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' Tags:
Parameters:
[ Top ]
method fieldExists [line 1184]
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 and fetchFieldNames() has been called before, the cached values will be used. Tags:
Parameters:
[ Top ]
method fieldFlags [line 763]
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 they are not flags but field types. You're descouraged to use them. Tags:
Parameters:
[ Top ]
method fieldLen [line 730]
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() . Tags:
Parameters:
[ Top ]
method fieldName [line 652]
Get the field name at the specified offset from a result id. This is a wrapper for mysql_field_name(). Tags:
Parameters:
[ Top ]
method fieldType [line 854]
Get the type of a field at the specified offset from a result id. This is a wrapper for mysql_field_type(). CAUTION: The returned types are not the real mysql field types!! +----------------------------+ | mysql type | returned as |
Tags:
Parameters:
[ Top ]
method freeResult [line 637]
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. Tags:
Overrides Bs_Db::freeResult() (Free the internal resources associated with $result.) Parameters:
[ Top ]
method getClientInfo [line 2361]
Returns a string that represents the client library version. This method is a wrapper for 'string mysql_get_client_info(void)' and was made available in php405. Tags:
[ Top ]
method getDbStructure [line 1113]
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') ); Tags:
Parameters:
[ Top ]
method getHostInfo [line 2374]
Returns a string describing the type of connection in use, including the server host name. This method is a wrapper for 'string mysql_get_host_info([int link_identifier])' and was made available in php405. Tags:
[ Top ]
method getIniVar [line 2241]
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): note: in 3.23.47-max-nt the first value 'ansi_mode' isn't there [anymore]. and there are 107 vars in total. +-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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 out incorrectly 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. Tags:
Parameters:
[ Top ]
method getOpenTables [line 2087]
Returns the currently open tables in $db. This is somehow similar to fetchTableNames() but only returns the open ones. NOTE: Tables may exist and be open but you don't have the perms so you won't see them! This method uses the mySQL 'SHOW OPEN TABLES' syntax. the returned value looks like: 'vector' => array('table1, table2, table3') 'string' => 'table1, table2, table3' 'extended' => array(array('name' => 'table1', 'cached' => '1', 'in_use' => '0'), array('name' => 'table2', 'cached' => '5', 'in_use' => '1')) As you can see, also the numbers are returned as strings, not as int. If the method was not able to read out a number (speaking of cached and in_use), a question mark '?' will be there instead. Tags:
Parameters:
[ Top ]
method getProtocolInfo [line 2387]
Returns the protocol version used by current connection. This method is a wrapper for 'int mysql_get_proto_info([int link_identifier])' and was made available in php405. Tags:
[ Top ]
method getServerInfo [line 2400]
Returns a string that represents the server version number. This method is a wrapper for 'string mysql_get_server_info([int link_identifier])' and was made available in php405. Tags:
[ Top ]
method getStatusVar [line 2333]
Return the value of the specified status var. as of 3.23.36, the following 54 vars are available (with example values): +-------------------------+-------+ | Variable_name | Value | +-------------------------+-------+ | Aborted_clients | 7 | | Aborted_connects | 0 | | Bytes_received | 0 | | Bytes_sent | 0 | | Connections | 106 | | Created_tmp_disk_tables | 0 | | Created_tmp_tables | 0 | | Created_tmp_files | 0 | | Delayed_insert_threads | 0 | | Delayed_writes | 0 | | Delayed_errors | 0 | | Flush_commands | 1 | | Handler_delete | 0 | | Handler_read_first | 37 | | Handler_read_key | 72 | | Handler_read_next | 0 | | Handler_read_prev | 0 | | Handler_read_rnd | 0 | | Handler_read_rnd_next | 514 | | Handler_update | 36 | | Handler_write | 159 | | Key_blocks_used | 41 | | Key_read_requests | 190 | | Key_reads | 0 | | Key_write_requests | 159 | | Key_writes | 159 | | Max_used_connections | 20 | | Not_flushed_key_blocks | 0 | | Not_flushed_delayed_rows| 0 | | Open_tables | 0 | | Open_files | 0 | | Open_streams | 0 | | Opened_tables | 166 | | Questions | 1316 | | Select_full_join | 0 | | Select_full_range_join | 0 | | Select_range | 0 | | Select_range_check | 0 | | Select_scan | 72 | | Slave_running | OFF | | Slave_open_temp_tables | 0 | | Slow_launch_threads | 0 | | Slow_queries | 0 | | Sort_merge_passes | 0 | | Sort_range | 0 | | Sort_rows | 0 | | Sort_scan | 0 | | Table_locks_immediate | 346 | | Table_locks_waited | 0 | | Threads_cached | 0 | | Threads_created | 105 | | Threads_connected | 20 | | Threads_running | 1 | | Uptime | 200222| +-------------------------+--------+ this method uses the 'SHOW STATUS' syntax. Tags:
Parameters:
[ Top ]
method getTableInfo [line 1924]
Returns a 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 | | | +------+--------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+---------------------+------------+----------------+---------+ Tags:
Parameters:
[ Top ]
method getTableLastmod [line 1847]
returns the datetime of the last change to the data of the given db table. changes are things like insert, update, delete, drop, whatever. uses getTableInfo(). Tags:
Parameters:
[ Top ]
method getTableProperties [line 1798]
!!!!!!!!!!!!!!!!deprecated!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!deprecated!!!!!!!!!!!!!!!!!!!!!! use getTableStructure() it's a better name and returns better/more info. Return an array with information about the fields of the given db table. array('fieldName' => array('Type' => 'char', // field type 'Length' => '16' // field leng OR if type=='enum' amount of enums 'Enum' => "'Y','N'" // if type=='enum' the enum values as string: "'value','value',..." 'Null' => (bool?) 'Key' => (bool?) 'Default' => 'N' 'Extra' => string // binary auto_increment zerofill null unsigned ) ); Tags:
Parameters:
[ Top ]
method getTablesLastmod [line 1883]
this is similar to getTableLastmod(), note the extra s. it returns the newest datetime of all the given db tables. all db's need to be on the same machine, and you cannot give a dsn for them. add that functionality when you need it. :) this method uses getTableLastmod(). param $dbs: it's a vector holding hashes with the keys 'table' and 'db' where table is the table name and db is the db name. if the db key is not set or empty, the default database is used. example: $dbs = array( array('table'=>'a', 'db'=>'test'), array('table'=>'b') ); Tags:
Parameters:
[ Top ]
method getTableStructure [line 1334]
Returns an array with information about the fields of the given db table. --sam : if ($tmpFieldName == 'ID') it's the wrog place to do debedo stuff 2002-11-28 example return value: array('fieldName' => array('type' => 'char', 'length' => 16 // field length OR if type=='enum' number of enums 'enum' => mixed bool FALSE or array('Y','N') // if type=='enum' the enum values as array 'default' => mixed // string or int or NULL. 'notNull' => bool // true = not null, false = null 'primaryKey' => bool 'multipleKey' => bool // indecates the field has an index 'fulltext' => bool // Is fulltext indexed, RTFM 'unique' => bool 'unsigned' => bool 'zerofill' => bool 'binary' => bool 'autoIncrement' => bool 'foreignKey' => array ) ); 'type': field type. possible values are: char, varchar, int, blob, ... 'foreignKey': bool FALSE if it's none. hash with these keys if it's one: 'db' => null (or string if it's different) 'table' => string 'multiple' => bool (IDs) Tags:
Parameters:
[ Top ]
method getTableType [line 1950]
Returns the table type of the specified db table. Tags:
Parameters:
[ Top ]
method hasFieldFlag [line 810]
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! Tags:
Parameters:
[ Top ]
method insertId [line 624]
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 query that generates the value. This method is save, thanks to rick@surveyor.com for the information :) NOTE I : RTFM for mysql_insert_id()! There are some spcial cases! NOTE II: Returns FALSE if you use "INSERT DELAYED ..." I heared ppl complaining that recent versions only work if link_identifier is omitted. Tags:
Overrides Bs_Db::insertId() (Get the id generated from the previous INSERT operation.) [ Top ]
method isReservedWord [line 2488]
Tells if a word is a reserved word for mysql. This is a 'shortcut' for => "7.39 Is MySQL Picky About Reserved Words?" and is great for something like an autmated system checkup. HINT: Make a type conversion (bool) and check for true or false on the returned value. From the manual: A common problem stems from trying to create a table with column names that use the names of datatypes or functions built into MySQL, such as TIMESTAMP or GROUP. You're allowed to do it (for example, ABS is an allowed column name), but whitespace is not allowed between a function name and the `(' when using functions whose names are also column names. The following words are explicitly reserved in MySQL. Most of them are forbidden by ANSI SQL92 as column and/or table names (for example, group). A few are reserved because MySQL needs them and is (currently) using a yacc parser: Tags:
Parameters:
[ Top ]
method isValidName [line 2458]
Tells if a name for a db, table or field is accepted by mysql or not. Tags:
Parameters:
[ Top ]
method listDatabases [line 871]
returns a result identifier for the available databases. note: with mysql you see all db's even if you have no access to them. that may be different in other rdbms. this is a wrapper for mysql_list_dbs(). Tags:
[ Top ]
method listFields [line 909]
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! Tags:
Parameters:
[ Top ]
method listTables [line 888]
Retrieves information about the given table. (does it? is that text correct? --andrej) This is a wrapper for mysql_list_tables(). NOTE: Tables may exist but if you don't have the perms, you won't see them! Tags:
Parameters:
[ Top ]
method nativeError [line 2604]
Returns the native error from the previous MySQL operation or '' (empty string) if no error occured. Tags:
[ Top ]
method nativeErrorCode [line 2576]
Returns the numerical native error code from the previous MySQL operation or 0 (zero) if no error occured. This method is a wrapper for mysql_errno(). Tags:
Overrides Bs_Db::nativeErrorCode() (Returns the numerical native error code from the previous DB operation or 0 (zero) if no error occured.) [ Top ]
method nativeErrorMsg [line 2591]
Returns the native error text from the previous MySQL operation or '' (empty string) if no error occured. This method is a wrapper for mysql_error(). HINT: Better use nativeErrorCode() before calling this method, or call nativeError() directly. Tags:
Overrides Bs_Db::nativeErrorMsg() (Returns the native error text from the previous DB operation or '' (empty string) if no error occured.) [ Top ]
method numCols [line 554]
Get the number of columns (fields) from a result set. Tags:
Overrides Bs_Db::numCols() (Get the number of columns (fields) in a result identifier.) Parameters:
[ Top ]
method numRows [line 572]
Get the number of rows from a result set. Tags:
Overrides Bs_Db::numRows() (Get the number of rows from a result identifier.) Parameters:
[ Top ]
method rollback [line 304]
Rollback last query Tags:
Overrides Bs_Db::rollback() (Rollback last query) Parameters:
[ Top ]
method selectDb [line 409]
Select a MySQL database. this is a wrapper for mysql_select_db(). Tags:
Parameters:
[ Top ]
method serverSupportsTableType [line 2004]
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 course TRUE is returned. The default mysql table type currently is MyISAM according to the manual. If you try to create one that's not supported or not compiled into the server, a MyISAM table will be created instead. ISAM is deprecated, it is replaced by MyISAM. BDB, INNOBASE and GEMINI are transaction-safe, the others are not. hrm. i've found an ini var called 'table_type' with the value 'MYISAM'. Prolly you can change the default table type here. Tags:
Parameters:
[ Top ]
method setPointer [line 2435]
Sets the internal row pointer of the result id to point to the specified row number. The next fetch call would return that row. Tags:
Overrides Bs_Db::setPointer() (Set the internal row pointer of the result id to point to the specified row number.) Parameters:
[ Top ]
method startTransaction [line 269]
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 calling other 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 will terminate the transaction! To prevent sub-routines from closing the 'Masters' transaction you may start a transaction and pass a 'transaction ID'. Folloing commits/rollbacks are ignored as long as it dosen'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*. Tags:
Overrides Bs_Db::startTransaction() (Starts a transaction) Parameters:
[ Top ]
method subSelect [line 465]
Handles a single nested SELECT statement to overcome that limitation in MySql as it isn't suported (yet). E.g. SELECT q,r,t FROM x WHERE y IN (SELECT ID FROM z WHERE ...) ORDER BY xxx; DELETE FROM x WHERE y IN (SELECT ID FROM z WHERE ...); NOTE I : The sub-select will only use the first colomn in the subselect !! To minimise the overhead, just fetch the 1 colomn in the subselect. NOTE II : The sub-select must be in parenthe and no parenthe may be used *in* the sub-select. MySql V3.23 states in 5.4.1 Sub-selects: "For more complicated subqueries you can often create temporary tables to hold the subquery. In some cases, *however* this option will not work. The most frequently encountered of these cases arises with DELETE statements, for which standard SQL does not support joins (except in sub-selects). For this situation there are two options available until subqueries are supported by MySQL. The first option is to use a procedural programming language (such as Perl or PHP) to submit a SELECT query to obtain the primary keys for the records to be deleted, and then use these values to construct the DELETE statement (DELETE FROM ... WHERE ... IN (key1, key2, ...))." Tags:
Parameters:
[ Top ]
method tableExists [line 1222]
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 on iX, *but* INsensitive 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 and fetchTableNames() has been called before, the cached values will be used. Tags:
Parameters:
[ Top ]
method tableHasTransactions [line 1968]
Tags:
Parameters:
[ Top ]
method tableName [line 670]
Returns the name of the table that the field (specifed by an offset) is in. This is a wrapper for mysql_field_table(). Tags:
Parameters:
[ Top ]
method tableName2 [line 689]
Get the name of the specified table in a result you got from mysql_list_tables(). This is a wrapper for mysql_tablename(). Tags:
Parameters:
[ Top ]
method updateTableStructure [line 1487]
updates an existing db table to the desired structure. Idea of a param $shrink: *NOT IMPLEMENTED (YET?)* if we should 'shrink' the table in any way.
Tags:
Parameters:
[ Top ]
method _dbErrorToBsError [line 2662]
Maps error codes of the current dbms to bs-dbErrorCodes. Tags:
Parameters:
[ Top ]
Documentation generated on Mon, 29 Dec 2003 21:11:56 +0100 by phpDocumentor 1.2.3 |

