note: error info after trying to connect includes 'MDB2.php' (include_path='.;C:\php5\pear')
I noticed some potential solutions on this in a closed post. After installing pear and installing mdb2 using the pear install. You have to install the driver for the db you will be accessing:
at a command prompt from tht php directory run this.
pear install MDB2_driver_mysqli
Note: the code below fails with the cannot find mdb2.php error (before the install above and works after). I found some info on this site as a solution to this error involving moving an ini file around, none of them worked for me but the install above did. I think it is an incomplete install bug not an ini bug.
FYI Good luck Mike A
Expand|Select|Wrap|Line Numbers
- <?php
- require_once 'MDB2.php';
- $mdb2 = MDB2::connect('mysqli://root:mysql@localhost/test');
- if (PEAR::isError($mdb2)) {
- die($mdb2->getMessage() .' , '. $mdb2->getDebugInfo());
- }
- else
- print 'connection succeeded';
- ?>