Skip to content

Instantly share code, notes, and snippets.

@greenpeas
Created July 22, 2014 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenpeas/1658abda5660fcd1f181 to your computer and use it in GitHub Desktop.
Save greenpeas/1658abda5660fcd1f181 to your computer and use it in GitHub Desktop.
работа с ms sql в php
<?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