Welcome Guest, Not a member yet? Register   Sign In
DB Connection problems in external library
#1

[eluser]Unknown[/eluser]
HI,

I am refactoring an existing website to use codeigniter but want to use one of the existing Libraries to do specific soap calls. The constructor for the class takes a couple of parameters and a MYSQLI connection. I dont want to have to rewrite the existing Library as it works very well. However when I create the class from within codeigniter it never seems to allow me to connect to the database from within the external libarary.

Code extract.. This is from within one of my models..
require_once '/var/www/html/soap/class.SoapCall.php';
$SoapStuff = new SoapCall($caid,$trid,$this->db->conn_id);
$SoapStuff->doSomething();

This all creates the class correctly but when I try and access any database queries in the doSomething method of the external class I keep getting an error..

Any ideas?
#2

[eluser]CroNiX[/eluser]
We'd need to see your doSomething() code where the action is actually taking place.

One thing to note is that libraries don't automatically have access to the CI super object because they don't extend CI like controllers/models do. You have to manually bring the instance into the library. This is covered in the user guide for libraries. If that isn't your problem please post the relevant code (in code tags).




Theme © iAndrew 2016 - Forum software by © MyBB