[eluser]tim1965[/eluser]
Ok here it is. I will only post the relevant part which is this first if. If i dump the query i can see the correct data being pulled back from the db.
function update_contact_details()
{
$this->output->enable_profiler(TRUE);
$z=$this->uri->segment(4);
if(isset($z))
{
$p = $this->uri->segment(4);
$this->session->set_userdata('x', $p);
}
else
{
$p = $_POST['propid'];
$this->session->set_userdata('x', $p);
}
$prop = $this->session->userdata('x');
$propid = $prop['x'];
$this->load->model('property_management/M_master_contact_details_v1');
$this->load->library('form_validation');
$this->form_validation->set_rules('title', 'Title', 'trim|xss_clean|required|alpha');
$this->form_validation->set_rules('first_name', 'First Name', 'trim|xss_clean|required|max_length[50]|alpha');
$this->form_validation->set_rules('last_name', 'Last Name', 'trim|xss_clean|required|max_length[50]|alpha');
$this->form_validation->set_rules('firstlineofaddress', '1st line of Address', 'trim|xss_clean|required|max_length[50]|alpha_dash_space');
$this->form_validation->set_rules('secondlineofaddress', '2nd line of Address', 'trim|xss_clean|max_length[50]|alpha_dash_space');
$this->form_validation->set_rules('townorcity', 'Town or City', 'trim|xss_clean|required|max_length[50]|alpha_dash_space');
$this->form_validation->set_rules('provinceorcounty', 'Province, County or State', 'trim|xss_clean|required|max_length[50]|alpha');
$this->form_validation->set_rules('postcode', 'Post\Zip code', 'trim|xss_clean|required|max_length[15]|alpha_numeric');
$this->form_validation->set_rules('country', 'Country', 'required|max_length[50]|alpha');
$this->form_validation->set_rules('contactnotes', 'Contact Notes', 'trim|xss_clean|required|max_length[300]|alpha_dash_space');
$this->form_validation->set_rules('contactpref', '', '');
$this->form_validation->set_rules('languages', 'languages', '');
$this->form_validation->set_rules('languageother', 'Other language', 'trim|xss_clean|max_length[30]|alpha_dash_space');
$this->form_validation->set_rules('adverttype', 'Type of advert', 'required');
$this->form_validation->set_rules('terms', 'Accept our Terms', 'required');
if ( ! $this->form_validation->run() && $this->validation->error_string == '')
{
$data =$this->M_master_contact_details_v1->get_contact_details($propid);
$data['propid'] = $prop['x'];
$this->load->view('property_management/contact_details/v_contact_details_template_v1',$data);
}