Welcome Guest, Not a member yet? Register   Sign In
need help
#1

[eluser]dang2man[/eluser]
hello

i need help with my application the problem is when user login he can edit his information

but not all information just 4 column

this my model function getUser($id){
$data = array();
$this->db->where('id',$id);
$this->db->limit('1');
$query = $this->db->get('employees');
if($query->num_rows > 0){
$data = $query->row_array();
}
$query -> free_result();
return $data;

}
}

and this controller

function edit($id = 0){

if($_POST){
$this->get_user_date->updateUser();

}
else{
$data['title'] = "edit information";
$data['get']= $this->get_user_data->getUser($id);
$this->load->vars($data);
$this->load->view('members/dashboard');
}
}

this view

<?php
echo form_open('members/dashboard/edit');
echo "<p><label for='code'>code</label><br/>";
$data = array('name'=>'id','id'=>'code','size'=>25, 'value'=>$get['id']);
echo form_input($data) ."</p>";

echo "<p><label for='userType'>User type</label><br/>";
$data = array('name'=>'userType','id'=>'type','size'=>25, 'value'=>$get['user_type']);
echo form_input($data) ."</p>";



echo form_submit('submit','Update User');
echo form_close();


?&gt;


its only get id when id = 0


any help please




Theme © iAndrew 2016 - Forum software by © MyBB