Welcome Guest, Not a member yet? Register   Sign In
Verify if alias existe in the field user_data in ci_sessions
#1

[eluser]Unknown[/eluser]
Hello folks,

Does anybody have an idea how i could verify if the alias already exist in a ci_sessions rows.

I use these 2 functions.

Code:
function _verification_double_login()
{  
  $q = $this->db->query('SELECT user_data FROM ci_sessions');
  
  if($q->num_rows() > 0)
  {
   foreach($q->result() as $row)
   {
    $row = @unserialize(strip_slashes($row->user_data));
    if (is_array($row))
             {
                    array_walk_recursive($row, array(&$this, '_unescape_slashes'));
                    return $row;
          }
    return (is_string($row)) ? str_replace('{{slash}}', '\\', $row) : $row;
   }
  }
}

function _unescape_slashes(&$val, $key)
    {
  if (is_string($val))
  {
   $val = str_replace('{{slash}}', '\\', $val);
  }
    }




Theme © iAndrew 2016 - Forum software by © MyBB