Created
September 9, 2014 19:26
-
-
Save khoand0000/ff3a515de11cd2f21df1 to your computer and use it in GitHub Desktop.
connect azure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
$conn = odbc_connect( | |
"DRIVER={SQL Server};Server=tcp:ac1wr559wv.database.windows.net,1433;Database=1407_test", | |
"project", "Plastic48"); | |
$cur = odbc_exec($conn, "select username, password, address from users"); | |
while (odbc_fetch_row($cur)) { | |
//collect results | |
$username = odbc_result($cur, 1); | |
$password = odbc_result($cur, 2); | |
$firstName = odbc_result($cur, 3); | |
//format and display results | |
print ("<p>$username, $password, $firstName</p>"); | |
} | |
//disconnect from database | |
odbc_close($conn); | |
// var_dump($conn); | |
} catch (Exception $e) { | |
echo "<pre>"; | |
var_dump($e); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment