Skip to content

Instantly share code, notes, and snippets.

@fredrike
Last active August 29, 2015 14:19
Show Gist options
  • Save fredrike/3d745c9f7dcae97b3feb to your computer and use it in GitHub Desktop.
Save fredrike/3d745c9f7dcae97b3feb to your computer and use it in GitHub Desktop.
Test connection to SQL Server @ BTH
<html>
<title>BTH Database Test</title>
<pre>
<?php
DEFINE("_SQL_SERVER_", "194.47.129.139");
DEFINE("_SQL_USER_", "");
DEFINE("_SQL_PASSWORD_", "");
DEFINE("_SQL_DATABASE_", _SQL_USER_);
// Connect to MSSQL
$link = mssql_connect(_SQL_SERVER_, _SQL_USER_, _SQL_PASSWORD_);
if (!$link || !mssql_select_db(_SQL_DATABASE_, $link)) {
die('Unable to connect or select database!');
}
$version = mssql_query('SELECT @@VERSION');
$row = mssql_fetch_array($version);
echo $row[0];
?>
</pre>
</html>
@fredrike
Copy link
Author

Man ska alltså använda mssql drivrutien i BTHs miljö (http://php.net/manual/en/ref.mssql.php).

För att lägga upp filer använder ni winSCP mot servern ssh.student.bth.se.
Era filer lägger ni sedan i www katalogen och ni kommer åt dem på http://www.student.bth.se/~<ert akronym>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment