[TYPO3-dev] non typo3 Database Selection error !!

nirmalya Mondal nirmalya at fivee.in
Sat Jan 6 07:56:15 CET 2007


Hello,
In my own extension its needed to select another database that is not 
typo3 database. For this i've written this code
---------------
  function databaseConnection(){

		$extnConf = 
unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['fivee_oscommerce']);
		$host 		= $extnConf[db_host];
		$user 		= $extnConf[db_user];
		$password 	= $extnConf[db_password];
		$dbasename 	= $extnConf[db_name];
		$connDb = @mysql_connect($host,$user,$password)or die('Not Connected:' 
.mysql_error());
				
		
			$selectDb = mysql_select_db($dbasename,$connDb) or die('Database 
selection Failed' .mysql_error());
					
	}	

ERROR:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL 
result resource in /myWebDirectory/t3lib/class.t3lib_db.php on line 802
-----------------
when i've commented out
"//$selectDb = mysql_select_db($dbasename,$connDb) or die('Database 
selection Failed' .mysql_error());" this line no error message is 
displaying.
This extension is generating its output properly.

Thank You.
Regards,
Nirmalya Mondal
--------
http://www.fivee.in




More information about the TYPO3-dev mailing list