Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $server = SERVER
- $port = PORT
- $user = USER
- $password = PASSWORD
- $database = DATABASE
- ### MYSQL ###
- $connection = new PDO("mysql:host=$server;dbname=$database;charset=utf8",$user,$password);
- ### SQLSRV ###
- $connection = new PDO("sqlsrv:Server=$server,$port;Database=$database;charset=utf8", $user, $password);
- ### ORACLE ###
- $connection = new PDO('oci:dbname=$server/$port;charset=AL32UTF8', $user, $password);
- // or
- $tns = "(DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP)(HOST = $host)(PORT = $port))
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = $database)
- )
- )";
- $connection = new PDO('oci:dbname=$tns;charset=AL32UTF8',$user,$password');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement