php - Codeigniter Active Record inside custom library class -


My job breaks on the line where I make an active record call, so I should not call the right things .

  & lt ;? Php if (! Defined ('BASEPATH')) exit ('no direct script entry is allowed'); Class stuff {public function specific ($ passer)} {resonant "test"; $ CI = & amp; get Instance(); $ CI- & gt; Load-> Database (); $ CI- & gt; Load-> Assistant ('array'); $ CI- & gt; Load-> Assistant ('format_helper'); $ Data array = $ this- & gt; Db- & gt; Where ($ column_name, $ stock new); $ Data array = $ this- & gt; Db- & gt; Get ($ tablename); Echo "Bolx!";  

"Test" will echo, but not Balox!

You should use $ CI-> db -> ... not $ this-> db


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -