I have been banging my head for 5 hours and I finally solved the problem but I just cannot go to sleep without knowing the reason. Let me explain the issue first.
I have used codeigniter HMVC extension and installed ion_auth as a separate module.
|-modules
|--auth
|---config
|-----ion_auth.php
|---controllers
|-----auth.php
|---models
|-----ion_auth_model.php
|---views
When I was trying to get a user's group I started to get wired SQL errors. Then I narrowed the issue and figured out that the items in config/ion_auth.php
were not loaded in the ion_auth_model.php
file.
ERROR - 2016-02-24 20:09:26 --> Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as
id
, .name
, .description
JOIN ON .=.id
WHERE . = '2'' at line 1 - Invalid query: SELECT . asid
, .name
, .description
JOIN ON .=.id
WHERE . = '2'
Then I tried couple of stuffs and when I remove the index 'ion_auth'
from
couple of method calls in ion_auth_model.php
everything started to work.
I changed
$this->tables = $this->config->item('tables', 'ion_auth');
$this->join = $this->config->item('join', 'ion_auth);
to
$this->tables = $this->config->item('tables');
$this->join = $this->config->item('join');
Can anyone tell me why it worked?