Created
July 22, 2014 18:04
-
-
Save greenpeas/1658abda5660fcd1f181 to your computer and use it in GitHub Desktop.
работа с ms sql в php
This file contains 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 | |
$server = '88.xxx.xxx.xxx\SQLEXPRESS'; | |
$link = mssql_connect($server, 'db_username', 'db_password'); | |
if (!$link) { | |
die('Something went wrong while connecting to MSSQL'); | |
} | |
mssql_select_db('database_name', $link); | |
$query_result = mssql_query('SELECT * FROM MenuItems'); | |
$result = array(); | |
while ($row = mssql_fetch_object($query_result)){ | |
$result[] = $row; | |
} | |
echo '<pre>'; | |
print_r($result); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment