0
You have two options to try:
$pdo = new PDO ("mssql:host=$hostname;dbname=$dbname","$username","$pw");
or
$pdo = new PDO( "sqlsrv:server=$serverName ; Database=$dbname", "$username", "$pw");
It depends on the driver you installed in PHP.
[Edited] An example of select with PDO
//retornar o resultset
$sql = 'Select * from products';
$result = $pdo->query($sql);
// imprimir resultados um a um
while ($campos = $result->fetch()){
echo $campos['ProductID']. ' - '.$campos['ProductName'].'<br />';
}
What code are you using for connection?
– Rodrigo Brito
I tried several ja... but without success... the class q I always use in mysql/postgtee is this: http://answall.com/q/182026/32918
– Augusto Furlan