Welcome Guest, Not a member yet? Register   Sign In
Session ID
#3

(This post was last modified: 01-29-2016, 08:15 AM by morocho1979.)

(01-29-2016, 07:38 AM)pdthinh Wrote:
(01-29-2016, 07:26 AM)morocho1979 Wrote: Hi im a newbbie , i need you help or advise , 

im making some report and i need to use the "id" from 
PHP Code:
$this->session->userdata('logged_in'); 

 i check 
$ses= $this->session->userdata('logged_in');
echo '<pre>';
print_r($ses);
and my data is 
[id] => 23
   [username] =>John Doe 


now how i can use this id because i do this and dont show anything 

$ses= $this->session->userdata('id');

echo '<pre>';
print_r($ses);
   

Your id is stored as an element in the $ses array so to access it you can use $ses['id']

no i want to use in my model so i try this 

PHP Code:
 function obtenerListaClientes()
 
   {
 
    
      $this
->db->select('nombre_fantasia,direccion,fono, url');
 
     $this->db->from('clientes,users');
 
     $this->db->where('id_usuario = id AND id_usuario ='$ses);
 
     $clientes $this->db->get();

 
     return $clientes->result(); 

in the controller i add 

$ses= $this->session->userdata('logged_in');

ofcourse no work i dont have any idea thx for the help
Reply


Messages In This Thread
Session ID - by morocho1979 - 01-29-2016, 07:26 AM
RE: Session ID - by pdthinh - 01-29-2016, 07:38 AM
RE: Session ID - by morocho1979 - 01-29-2016, 08:05 AM
RE: Session ID - by josepostiga - 01-29-2016, 09:04 AM
RE: Session ID - by freddy - 01-29-2016, 07:06 PM



Theme © iAndrew 2016 - Forum software by © MyBB