• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to load DB_froge class inside my own driver?

Hello there. I've my own driver called data_driver.php and using this drriver, I want to create some database tables. Whenever I'm going to load db_forge class into my driver there is an error saying:

Invalid driver requested: Data_driver_dbforge

I think the load request treating db_forge as a child driver. So what to do now? Looking forword to your answer.
Thanks in advance.
"Who thinks in code"
Perfectly describes who I am

I'm assuming data_driver is a database driver. In most cases, when building a new database driver I would recommend looking at the MySQLi driver as a reference. Each driver is structured as a directory with the base driver name, followed by a series of files to support the various portions of the database library/libraries, so the file/directory structure looks something like this:

It gets a little more complicated for drivers like PDO, which have their own subdrivers.

When you load DB_forge, it gets the driver information from the database library, then loads a file from /system/database/drivers/{driver_name}/{driver_name}_forge.php to tell it how DB_forge is going to interact with the underlying database. If this file doesn't exist, you can't use DB_forge for the current driver.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.