[eluser]gedev2006[/eluser]
Hi
I have an issue im just not understanding.
Im using curl in an external script to access a CI controller. Lets say for example
Code:
$_curl = curl_init ( "http://test.com/index.php/test/example" );
$_result = curl_exec( $_curl );
So, this works fine, lets say the controller looks like this:
Code:
class Test extends Controller {
public function example(){
$this->load->model ( 'testing' );
$_data = $this->testing->test();
echo $_data;
}
}
All good so far. So lets look at the model:
Code:
class Testing extends Model {
public function test() {
$_result = $this->db->query ( "QUERY STRING HERE");
}
}
ok so i stopped the code there. because im getting the following error:
[quote]Fatal error: Using $this when not in object context[/code]
but...if i create the model like this:
Code:
$Model =& new Model();
$Model->db->query ( "QUERY STRING HERE");
it works fine!
so whats with the error?