abrahamkiev
New Member
I'm trying to use PHP ActiveRecord in Codeigniter.I have a model like this: \[code\]<?php class tblAdmins extends ActiveRecord\Model {} \[/code\]In my controller I have this:\[code\]class Welcome extends CI_Controller { function __construct() { parent::__construct(); $this->load->spark('php-activerecord/0.0.2'); } /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ public function index() { $name = tblAdmins::find_by_username('myname'); /*$this->load->view('welcome_message');*/ }}/* End of file welcome.php *//* Location: ./application/controllers/welcome.php */\[/code\]When open the page in CodeIgniter I get this error:\[quote\] Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message '42S02, 1146, Table 'CampusRecMobile.tbl_admins' doesn't exist' in C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\Connection.php:313 Stack trace: #0 C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\adapters\MysqlAdapter.php(25): ActiveRecord\Connection->query('SHOW COLUMNS FR...') #1 C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\Connection.php(254): ActiveRecord\MysqlAdapter->query_column_info('\[code\]tbl_admins\[/code\]') #2 C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\Table.php(370): ActiveRecord\Connection->columns('\[code\]tbl_admins\[/code\]') #3 C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\Cache.php(67): ActiveRecord{closure}() #4 C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\Table.php(370): ActiveRecord\Cache::get('get_meta_data-`.. in C:\xampp\htdocs\codeigniter\sparks\php-activerecord\0.0.2\vendor\php-activerecord\lib\Connection.php on line 313\[/quote\]Instead of looking for CampusRecMobile.tblAdmins it's looking for CampusRecMobile.tbl_admins (which is not a table). How can I get rid of this underscore?