I wonder if it is possible to include a independent query to a WordPress database within an OpenCart shop.
I tried a code like this in order to simply display one specific post onto a template:
Code: Select all
$wpbridge = new PDO('mysql:host='.$host.';dbname='.$base, $user, $pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
$wpquery = $wpbridge -> query(" [...] ");
$wpcontent = $wpquery -> fetch(PDO::FETCH_ASSOC);
Code: Select all
Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in [...]\home_test.inc on line 1
PDOException: could not find driver in [...]\home_test.inc on line 1
Does anybody know a possible way to sidestep this constraint (for using temporary a second connection)?
Regards,