Stavo facendo delle prove con PDO e devo interrogare MSSQL.
Codice PHP:
<h2>MySQL</h2>
<?php
$string_dsn = 'mysql:host=***;dbname=***'; // mysql
$string_username = '***';
$string_password = '***';
try {
$mypdo = new PDO($string_dsn, $string_username, $string_password);
}
catch(PDOException $e) {
echo 'Errore di connessione: '.$e->getMessage();
}
?>
<h2>Postgres</h2>
<?php
$string_dsn = 'pgsql:host=***;dbname=***'; // pgsql
$string_username = '***';
$string_password = '***';
try {
$mypdo = new PDO($string_dsn, $string_username, $string_password);
}
catch(PDOException $e) {
echo 'Errore di connessione: '.$e->getMessage();
}
?>
<h2>MsSQL</h2>
<?php
$string_dsn = 'mssql:host=***;dbname=***'; // mssql
$string_username = '***';
$string_password = '***';
try {
$mypdo = new PDO($string_dsn, $string_username, $string_password);
}
catch(PDOException $e) {
echo 'Errore di connessione: '.$e->getMessage();
}
?>
Perō come risultato mi da:
codice:
MySQL
Postgres
MsSQL
Errore di connessione: could not find driver
Mi mancano i driver per accedere a MSSQL, come faccio ad installarli su debian?
Non c'č un pacchetto PHP5-mssql come per Mysql o Postgres
c'č
Sybase / MS SQL Server module for php5
This package provides a module for Sybase and Microsoft SQL Server database connections directly from PHP scripts. It also includes the pdo_dblib module for use with the PHP Data Object extension.
l'ho installato, ma niente.
se lo lancio dal pc windows su xampp
il risultato č:
codice:
MySQL
Postgres
Errore di connessione: could not find driver
MsSQL
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\PDO_test\index.php on line 37