Php mssql
Aus metasec wiki
Einrichtung von MSSQL für PHP
apt-get install php4-sybase
/etc/freetds/freetds.conf
[datenbank1] host = 192.168.1.120 port = 1433 tds version = 7.0 client charset = UTF-8
#!/usr/bin/php4 -q <?php // query the users table for all fields $query = "SELECT * FROM table"; $connect = mssql_connect("datenbank1", "user", "pass") or die ("Could not connect to server"); if (!mssql_select_db('datenbank1', $verbindung)) { die('Konnte keine Datenbank auswählen!'); } // print($connect); // perform the query $result = mssql_query($query, $connect); // fetch the data from the database while($data = mssql_fetch_row($result)) { $col1 = trim($data[0]); $col2 = trim($data[1]); } mssql_close($connect); exit; ?>