Advertisement
Guest User

Untitled

a guest
Jun 21st, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php #Conexion con PDO
  2.  
  3.  
  4.  
  5. $conexion =new PDO("oci:dbname".$tns,$user,$pass);
  6. $conexion->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
  7.  
  8. class ConexionPDO extends PDO{
  9. #Llave conexión a Oracle, comentar si se quiere conectar a otra BD
  10. var $tns="(DESCRIPTION=(ADDRESS_List=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=DB1)))" ;
  11. var $user = "";
  12. var $pass = "";
  13.  
  14. public function __construct(array $options = null) {
  15. parent::__construct($this->tns, $this->user, $this->pass, $options);
  16.  
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement