Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $bd = $conexiones_db[$clave_con]['parametros']['bd'];
- $host = $conexiones_db[$clave_con]['parametros']['host'];
- $user = $conexiones_db[$clave_con]['parametros']['user'];
- $pass = $conexiones_db[$clave_con]['parametros']['pass'];
- $bdname = $conexiones_db[$clave_con]['parametros']['bdname'];
- $port = isset($conexiones_db[$clave_con]['parametros']['port'])?$conexiones_db[$clave_con]['parametros']['port']:'';
- if($bd=='postgres' || $port==''){
- $GLOBALS["con"] = NewADOConnection($bd);
- $GLOBALS["con"]->Connect($host, $user, $pass, $bdname) or errorConexion($bd,$host,$user,$bdname);
- }
- else{
- $cstr = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$host.")(PORT=".$port."))(CONNECT_DATA=(SID=".$bdname.")))";
- $GLOBALS["con"] = NewADOConnection($bd);
- $GLOBALS["con"]->Connect($cstr, $user,$pass);
- }
- $GLOBALS["con"]->SetFetchMode(ADODB_FETCH_ASSOC);
Add Comment
Please, Sign In to add comment