[Cs-content-commits] SF.net SVN: cs-content:[397] trunk/1.0/db_types/cs_phpDB__mysql.class.php
PHP Templating & Includes System
Brought to you by:
crazedsanity
|
From: <cra...@us...> - 2009-06-25 19:01:49
|
Revision: 397
http://cs-content.svn.sourceforge.net/cs-content/?rev=397&view=rev
Author: crazedsanity
Date: 2009-06-25 19:01:25 +0000 (Thu, 25 Jun 2009)
Log Message:
-----------
Allow selecting db on open connection (instead of doing a reconnect)
/db_types/cs_phpDB__mysql.class.php:
* select_db() [NEW]:
-- select a different database.
-- NOTE: this changes the internal "dbname" var on success, and
throws an exception on failure.
Modified Paths:
--------------
trunk/1.0/db_types/cs_phpDB__mysql.class.php
Modified: trunk/1.0/db_types/cs_phpDB__mysql.class.php
===================================================================
--- trunk/1.0/db_types/cs_phpDB__mysql.class.php 2009-06-19 14:20:16 UTC (rev 396)
+++ trunk/1.0/db_types/cs_phpDB__mysql.class.php 2009-06-25 19:01:25 UTC (rev 397)
@@ -772,6 +772,19 @@
+ //=========================================================================
+ public function select_db($dbName) {
+ if(mysql_select_db($dbName, $this->connectionID)) {
+ $this->dbname = $dbName;
+ }
+ else {
+ throw new exception(__METHOD__ .": failed to select db (". $dbName .")");
+ }
+ }//end select_db()
+ //=========================================================================
+
+
+
} // end class phpDB
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|