LocalDb and PDo

Oct 24, 2013 at 4:58 PM
Hi,

I have an issue with PDO and a localdb database connection.
But not with the main driver.

The next code works well:
$conMain = sqlsrv_connect( '(localdb)\v11.0', array( 'Database'=>'mydatabase'));
$tsql = "SELECT ite_id FROM t_items";
$stmt = sqlsrv_query( $conMain, $tsql);
while( $obj = sqlsrv_fetch_object( $stmt))
    echo $obj->ite_id."\n";

var_dump($conMain);
But then, it doesn't with a fatal error
$conPdo = new PDO("sqlsrv:Server=(localdb)\v11.0; Database=mydatabase");
var_dump($conPdo);
None protocols in connection string
Someone have the same thing ????
Or I failed my configuration.

Regards
Oct 24, 2013 at 5:17 PM
Shame on me....

Double quotes issue: solution
$conPdo = new PDO('sqlsrv:Server=(localdb)\v11.0; Database=mydatabase');