Create own library in the opencart. Problem with using DB
Posted: Thu Mar 17, 2016 11:20 pm
Hi all!
When I tried to create my own library with using database queries, I've got an error that I couldn't use a connection to the database.
Before using my own library I added further code to include it in my project in the file "my_site/admin/index.php":
Maybe anyone faced with this problem, as I can't find answer on my question..
When I tried to create my own library with using database queries, I've got an error that I couldn't use a connection to the database.
Code: Select all
Notice: Undefined property: ShippingDelivery::$db in J:\home\techno\www\system\library\shippingDelivery.php on line 44
Fatal error: Call to a member function query() on a non-object in J:\home\techno\www\system\library\shippingDelivery.php on line 44
Code: Select all
$mylibr = new ShippingDelivery();
$registry->set('mylibrary', $mylibr); // +