Post by gizmecano » Wed Jun 03, 2015 11:15 pm

Greetings,

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);
But I get this kind of error:

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
I presume my connection attempt collides with the main one (settled in system>library>db>mpdo.php) used by the shop.

Does anybody know a possible way to sidestep this constraint (for using temporary a second connection)?

Regards,

User avatar
New member

Posts

Joined
Mon Apr 13, 2015 9:21 pm

Post by IP_CAM » Thu Jun 04, 2015 12:41 am

just to mention it, I found something about Wordpress last night here:
http://www.opencarto.com/modules/recent ... press.html
Ernie
bigmax.ch

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 16 guests