[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