I am trying to use MDB2.php
. I have downloaded XAMPP with the PHP 5.4 version. I understand that, in order to use MDB2, I need to include
it in my PHP file. This is how I am doing it:
My createTable.php
file its in C:\Users\Lexy Feito\Desktop\xampp\htdocs\php\COPassig3
.
So I use the code:
require "../../../php/pear/MDB2.php";
to include the MDB2.php file located in C:\Users\Lexy Feito\Desktop\xampp\php\pear
however this is returning the following errors:
Deprecated: Assigning the return value of new by reference is deprecated in C:\Users\Lexy Feito\Desktop\xampp\php\pear\MDB2.php on line 390
Deprecated: Assigning the return value of new by reference is deprecated in C:\Users\Lexy Feito\Desktop\xampp\php\pear\MDB2.php on line 1885 Deprecated: Assigning the return value of new by reference is deprecated in C:\Users\Lexy Feito\Desktop\xampp\php\pear\MDB2.php on line 2572
Deprecated: Assigning the return value of new by reference is deprecated in C:\Users\Lexy Feito\Desktop\xampp\php\pear\MDB2.php on line 2595
Deprecated: Assigning the return value of new by reference is deprecated in C:\Users\Lexy Feito\Desktop\xampp\php\pear\MDB2.php on line 2940
Strict Standards: Declaration of MDB2_Driver_Common::raiseError() should be compatible with & PEAR::raiseError($message = NULL, $code = NULL, $mode = NULL, $options = NULL, $userinfo = NULL, $error_class = NULL, $skipmsg = false) in C:\Users\Lexy Feito\Desktop\xampp\php\pear\MDB2.php on line 990
Could somebody tell me what is the correct way of using MDB2.php
to connect to MySQL and why I'm getting this errors?
If you look at those "errors", you will see that they are actually just warnings about old-fashioned ("deprecated" means "discouraged and planned for removal in some future version") or badly-written ("strict standards" just means "could be improved") code in the library.
The code will carry on running just fine. However, if this library is not currently maintained, you may find that in future you have to either make major changes to it yourself, or move away to a more modern library.
Check out the error_reporting
ini setting and error_reporting()
function for how to change which types of messages are displayed or logged.