Skip to content
Advertisement

codeigniter oc_ prefex database problem in server

i have created a website in codeignter, the website is working fine my local, i uploaded it to my server, then its showing the following error:

Table 'kirana_btp_new.oc_ci_sessions' doesn't exist

SELECT * FROM (`oc_ci_sessions`) WHERE `session_id` = '20e9bf3d13c5fbcad7582f354abaf8e3' AND `user_agent` = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36'

Filename: libraries/Session.php

coz my table names doesn’t start with _oc, i don’t know where this oc is coming from, below is a few code from the session.php where the error is showing.

if ($this->sess_match_useragent == TRUE)
			{
				$this->CI->db->where('user_agent', $session['user_agent']);
			}

			$query = $this->CI->db->get($this->sess_table_name);

			// No result?  Kill it!
			if ($query->num_rows() == 0)
			{
				$this->sess_destroy();
				return FALSE;
			}

can anyone please tell me what is wrong here? thanks in advance

Advertisement

Answer

please check your config database file you can add there prefix for db prefix

$db['default']['dbprefix'] = '';

you can check it from applicationconfigdatabase.php

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement