Changeset 2435
- Timestamp:
- 04/18/2008 08:12:19 AM
- Files:
-
- trunk/HISTORY (modified) (1 diff)
- trunk/framework/Data/TDbConnection.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/HISTORY
r2432 r2435 39 39 ENH: Ticket#757 - TDateFormat and TNumberFormat now implement IDataRenderer (Qiang) 40 40 ENH: Ticket#783 - Added date/time type support to soap implementation (Hongliang) 41 ENH: Ticket#800 - Added database connection charset for MySql (donkee)41 ENH: Ticket#800,#833 - Added database connection charset for MySql and PgSql (donkee) 42 42 ENH: Active Record supports multiple foreign references of the same table (Wei) 43 43 ENH: Added TDbCommand.queryColumn() (Qiang) trunk/framework/Data/TDbConnection.php
r2432 r2435 28 28 * and {@link setPassword Password}. 29 29 * 30 * Since 3.1.2, the connection charset can be set (for MySQL databases only) using the {@link setCharset Charset} property. 30 * Since 3.1.2, the connection charset can be set (for MySQL and PostgreSQL databases only) 31 * using the {@link setCharset Charset} property. The value of this property is database dependant. 32 * e.g. for mysql, you can use 'latin1' for cp1252 West European, 'utf8' for unicode, ... 31 33 * 32 34 * The following example shows how to create a TDbConnection instance and establish … … 101 103 * @param string The user name for the DSN string. 102 104 * @param string The password for the DSN string. 103 * @param string Charset used for DB Connection (MySql only). If not set, will use the default charset of your database server105 * @param string Charset used for DB Connection (MySql & pgsql only). If not set, will use the default charset of your database server 104 106 * @see http://www.php.net/manual/en/function.PDO-construct.php 105 107 */ … … 201 203 case 'mysql': 202 204 $stmt = $this->_pdo->prepare('SET CHARACTER SET ?'); 203 $stmt->execute(array($this->_charset));204 205 break; 205 } 206 case 'pgsql': 207 $stmt = $this->_pdo->prepare('SET client_encoding TO ?'); 208 break; 209 } 210 $stmt->execute(array($this->_charset)); 206 211 } 207 212
