glenelkins Posted October 13, 2009 Share Posted October 13, 2009 Hi This one is wierd! Im accessing a url, for example http://host.com/testing/test Say it looks like this class tempModel extends baseModel { public function testing() { $this->db->query ( "SQL QUERY HERE" ); // the db object is in baseModel } } class Testing extends baseController { public function test() { $_tempModel = new tempModel; $_tempModel->test(); } } [/code] to cut the story short, the url all works fine from the browser, but when using curl, it loads the model object but i then get this error: Using $this when not in object context This error is from $this->db->query line.... what is going on? Link to comment https://forums.phpfreaks.com/topic/177517-baffled-by-error-reported-when-using-curl/ Share on other sites More sharing options...
trq Posted October 13, 2009 Share Posted October 13, 2009 How exactly are you accessing this via curl? (A little confused) Curl simply makes http (or ftp, https etc etc) requests. Link to comment https://forums.phpfreaks.com/topic/177517-baffled-by-error-reported-when-using-curl/#findComment-936037 Share on other sites More sharing options...
Mark Baker Posted October 13, 2009 Share Posted October 13, 2009 so can we see the relevant section of baseModel? Link to comment https://forums.phpfreaks.com/topic/177517-baffled-by-error-reported-when-using-curl/#findComment-936063 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.