Ver Mensaje Individual
  #9 (permalink)  
Antiguo 24/05/2011, 09:59
reynierpm
 
Fecha de Ingreso: marzo-2011
Ubicación: Caracas
Mensajes: 140
Antigüedad: 13 años, 2 meses
Puntos: 1
Respuesta: Collation de tablas MySQL y PHP

Pues aqui esta:
Código PHP:
$enc = new EncryptDecrypt();

      
$user $enc->encriptar($_POST['username'], $this->config->item('encryption_key'));
      
$pass $enc->encriptar($_POST['password'], $this->config->item('encryption_key'));

      
$cond = array(
          
'usuario' => utf8_encode($user),
          
'pass' => utf8_encode($pass)
      );

      
$query $this->db->get_where('usuarios'$cond);

      if (
$query->num_rows() != 0) {
         
$row $query->row();
         
$session_data = array(
             
"id" => $row->id,
             
"usuario" => $row->usuario,
             
"logged_in" => TRUE
         
);
         
$this->session->set_userdata($session_data); 
Recuerda que uso CodeIgniter