Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = 'localhost';
- $port = '1443'; // porta
- $server = $port !== '1443' && is_string($port) ? $server .= ", $port": $server;
- $database = 'teste'; // Base de dados
- $user = 'User'; // User
- $pass = '123456'; // Pass
- $conn = sqlsrv_connect($server, array('Database' => $database, 'UID' => $user, 'PWD' => $pass));
- if($conn)
- {
- // Sucesso ao se conectar
- }
- else
- {
- // Falha ao se conectar
- echo "A conexão foi estabelecida.<br/>";
- die(print_r(sqlsrv_errors(), true));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement