<?php
// Hvis din connection-string fra dit ServicePoint ser ex. således ud:
// sqlcluster01.cloudip.dk\sql00000_1,52200
// Udfyldes felterne således:
$servername = "sqlcluster01.cloudip.dk";
$username = "sql00000_1_dbo"; // Eller en bruger, som du har oprettet i dit kundecenter
$password = "123ABC456def";
$database = "sql00000_1_db";
$port = "52200";
try {
$conn = new PDO("sqlsrv:server=$servername,$port;Database=$database;ConnectionPooling=0", $username, $password,
array(
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
)
);
} catch (PDOException $e) {
echo ("Error connecting to SQL Server: " . $e->getMessage());
}
$sql = "SELECT * FROM MinTabel";
foreach ($conn->query($sql) as $row) {
print_r($row);
}