2016-07-14 1 views
0

エラー番号:;}」session_id = 'f171da0c9be6fa5eb8d32905c8e1251b'ci_sessionの更新中にデータベースエラーが発生しましたか?私は複数のデータベースを使用していますか?

buz85ftp_buzoonga2.ci_sessions

UPDATE `ci_sessions` SET `last_activity` = 1468474888, `user_data` = 'a:11:{s:9:\"user_data\";s:0:\"\";s:6:\"userid\";s:3:\"670\";s:5:\"phone\";s:10:\"9956451235\";s:7:\"emailid\";s:15:\"[email protected]\";s:4:\"name\";s:6:\"Tester\";s:8:\"usertype\";s:1:\"1\";s:16:\"user_country_ref\";s:3:\"673\";s:12:\"user_country\";s:1:\"0\";s:9:\"time_zone\";s:12:\"Asia/Kolkata\";s:14:\"user_logged_in\";b:1;s:17:\"flash:new:success\";s:56:\" 

メッセージ(単数または複数)が存在しない1146

\」を削除しました

ファイル名:libraries/Session.ph P

行番号:288

function sess_write() 
    { 
     // Are we saving custom data to the DB? If not, all we do is update the cookie 
     if ($this->sess_use_database === FALSE) 
     { 
      $this->_set_cookie(); 
      return; 
     } 

     // set the custom userdata, the session data we will set in a second 
     $custom_userdata = $this->userdata; 
     $cookie_userdata = array(); 

     // Before continuing, we need to determine if there is any custom data to deal with. 
     // Let's determine this by removing the default indexes to see if there's anything left in the array 
     // and set the session data while we're at it 
     foreach (array('session_id','ip_address','user_agent','last_activity') as $val) 
     { 
      unset($custom_userdata[$val]); 
      $cookie_userdata[$val] = $this->userdata[$val]; 
     } 

     // Did we find any custom data? If not, we turn the empty array into a string 
     // since there's no reason to serialize and store an empty array in the DB 
     if (count($custom_userdata) === 0) 
     { 
      $custom_userdata = ''; 
     } 
     else 
     { 
      // Serialize the custom data array so we can store it 
      $custom_userdata = $this->_serialize($custom_userdata); 
     } 
     // Run the update query 
     $this->CI->db->where('session_id', $this->userdata['session_id']); 
     $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata)); 

     // Write the cookie. Notice that we manually pass the cookie data array to the 
     // _set_cookie() function. Normally that function will store $this->userdata, but 
     // in this case that array contains custom data, which we do not want in the cookie. 
     $this->_set_cookie($cookie_userdata); 
    } 
+0

レコードを削除中にこのエラーが発生します。データは削除されていますが、このエラーに直面していますか? –

+0

buz85ftp_buzoonga2データベースにci_sessionsテーブルが含まれていません。テーブルを手動で作成する必要があります。ドキュメントの[データベースドライバ](http://www.codeigniter.com/userguide3/libraries/sessions.html#database-driver)セクションで詳細を読むことができます。 –

+0

buz85ftp_buzoonga1データベースにci_sessionsが存在します。データベースを切り替えたい –

答えて

0

ます$ this-> CI->ロード - >データベース( 'データベース名'、TRUE)という名前のテーブルを作成します。

0

ci_sessionsやり直してください

+0

buz85ftp_buzoonga1データベースにci_sessionsが存在します。私はデータベースを切り替える:( –

+0

'buz85ftp_buzoonga1'はデフォルトのデータベースにする必要がありますので、CIは' $ this-> db'でアクセスできます。別のデータベースにアクセスするには、 '$また、 '$ this-> db-> db_select( '<あなたのデータベース名>')のような既存の接続とスイッチのデータベースを使用することができます:DB1 = $ this-> load-> database( 'group_one'、TRUE) ; ' –

関連する問題