Last active
August 29, 2015 14:19
-
-
Save fredrike/3d745c9f7dcae97b3feb to your computer and use it in GitHub Desktop.
Test connection to SQL Server @ BTH
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
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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>
.