Reputation: 216
I am working on project with codeigniter, all working properly only during one table operations, its showing error "table does not exist". Actually that table is present in database. Everything working properly on localhost. Only causing error "table does not exist" for only one table. Otherwise remaning things in project are working properly on live also.
I tried with following way:
$db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE;
are changed to FALSE.. then its showing "page is not responding" issue.
My Code Snippet (Of Model File):
public function getClubmember($edit_id = 0)
{
$this->db->select(" * ");
$this->db->from('XXXXXXX as XX');
if($edit_id){
$this->db->where('XX.id',$edit_id);
}
$this->db->order_by('XX.id', 'desc');
$result = $this->db->get();
return $result->result_array();
}
My Config Code:
....
....
$active_group = 'default';
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'XXXXXXX';
$db['default']['password'] = 'XXXXXXX';
$db['default']['database'] = 'XXXXXXX';
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
....
Please suggest me the changes to resolve issue of "table does not exists". Only issue one table.. remaining project working fine.
Upvotes: 1
Views: 865
Reputation: 721
I also faced such issue, you just need to check table name. It should be as it is. If one of the character may be capital in table of script. At such situation, task work properly on local, but give such error on live.
Just check script table name spell. Is there any letter capital or small because of which not matching with db table name.
Upvotes: 3