Welcome Guest, Not a member yet? Register   Sign In
Help session grab user_id from database
#48

[eluser]kesty[/eluser]
[quote author="Samus" date="1337788344"]
Code:
if($query) {
$result = $this->user_model->getCustomer();
foreach($result as $res) {
    $data = array(
                 'username'    => $this->input->post('username'),
     'is_user'     => true,
     'last_login'  => time(),
     'customer_id' => $res['id'], // assuming your db column name is 'id'
     'acc_number'  => $res['acc_number'],
     //'cust_id'     => $this->session->userdata('id') What's happening here? :S
              );
}

model
Code:
function getCustomer()
{
   $data = array();

   $Q = $this->db->get('users');
   if ($Q->num_rows() > 0){
        $data = $Q->result_array();
   }
     $Q->free_result();    
     return $data;
}

Let me know how that works[/quote]
i am not really in support with this ur idea, because it is not only going to return id but everything in the users table


Messages In This Thread
Help session grab user_id from database - by El Forum - 05-23-2012, 08:16 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:36 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:40 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:43 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:45 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:52 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:56 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 08:58 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:01 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:06 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:07 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:13 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:15 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:20 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 09:21 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:19 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:22 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:25 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:29 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:30 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:37 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 10:42 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 11:07 AM
Help session grab user_id from database - by El Forum - 05-23-2012, 12:42 PM
Help session grab user_id from database - by El Forum - 05-24-2012, 08:50 AM
Help session grab user_id from database - by El Forum - 05-24-2012, 09:06 AM
Help session grab user_id from database - by El Forum - 05-24-2012, 09:16 AM
Help session grab user_id from database - by El Forum - 05-24-2012, 09:35 AM
Help session grab user_id from database - by El Forum - 05-24-2012, 09:37 AM
Help session grab user_id from database - by El Forum - 05-24-2012, 10:30 AM
Help session grab user_id from database - by El Forum - 05-24-2012, 10:41 AM
Help session grab user_id from database - by El Forum - 05-25-2012, 08:57 AM
Help session grab user_id from database - by El Forum - 05-25-2012, 08:12 PM
Help session grab user_id from database - by El Forum - 05-25-2012, 08:29 PM
Help session grab user_id from database - by El Forum - 05-26-2012, 12:35 AM
Help session grab user_id from database - by El Forum - 05-26-2012, 03:01 AM
Help session grab user_id from database - by El Forum - 05-26-2012, 03:37 AM
Help session grab user_id from database - by El Forum - 05-26-2012, 09:03 AM
Help session grab user_id from database - by El Forum - 05-26-2012, 11:35 AM
Help session grab user_id from database - by El Forum - 05-28-2012, 01:35 AM
Help session grab user_id from database - by El Forum - 05-28-2012, 03:13 AM
Help session grab user_id from database - by El Forum - 05-29-2012, 04:40 AM
Help session grab user_id from database - by El Forum - 05-29-2012, 07:56 AM
Help session grab user_id from database - by El Forum - 05-29-2012, 09:52 AM
Help session grab user_id from database - by El Forum - 05-29-2012, 09:54 AM
Help session grab user_id from database - by El Forum - 05-29-2012, 11:37 AM
Help session grab user_id from database - by El Forum - 05-29-2012, 12:57 PM
Help session grab user_id from database - by El Forum - 06-09-2012, 09:07 PM
Help session grab user_id from database - by El Forum - 06-11-2012, 12:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB