Has anyone successfully installed Crate/PDO.
I seem to be banging my head against this one.
I have used composer to create the json file and when i try to
<?php
require 'vendor/autoload.php';
try {
$dbh = new PDO('crate:localhost:4200');
foreach($dbh->query('SELECT * from testtable') as $row) {
print_r($row);
}
$dbh = null;
}
catch (PDOException $e) {
print "Error!: " . $e->getMessage() . "<br/>";
die();
}
?>
It comes up with error Could not find driver.
Any help or installation documents would be great. anyone got any example code working.
The Crate PDO adapter is not official supported and included by PHP PDO, so the Crate PDO class must be used instead of the standard PDO class.
You should either import the Crate\PDO\PDO class by
use Crate\PDO\PDO;
or use a full qualified classname: