Welcome Guest, Not a member yet? Register   Sign In
get value from query and put on controller
#1

[eluser]ranggadablues[/eluser]
Hallo..

first sorry for my english.
I just create a contact form, I want for email to is dynamic that I can change for the email on my admin panel setup,the question is can I get value from query and put on controller here the script
Code:
function contact()
{  
  $data['email'] = $this->Pgallery_model->getEmail();
  
  $this->form_validation->set_rules('email','Email','trim|required|valid_email');
    
  if ($this->form_validation->run()==FALSE){  
   $this->load->view('contact', $data);
   } else {
    $config['protocol'] = 'sendmail';
    $config['mailtype'] = 'text';
    $config['charset'] = 'utf-8';
    $config['wordwrap'] = TRUE;
    $this->email->initialize($config);
    
    $this->email->to(/*here the query value*/);
    
    $this->email->send();    
    $this->load->view('contact_sukses', $data);
  }
}

here for my model
Code:
function getEmail()
{
  $query = $this->db->query('select email from setup');
  return $query->result();
}
I want
Code:
$this->email->to(/*here the query value*/);
get result on own controller, please help. Thank you


Messages In This Thread
get value from query and put on controller - by El Forum - 07-15-2012, 08:21 PM
get value from query and put on controller - by El Forum - 07-15-2012, 11:04 PM
get value from query and put on controller - by El Forum - 07-16-2012, 12:33 AM
get value from query and put on controller - by El Forum - 07-16-2012, 12:41 AM
get value from query and put on controller - by El Forum - 07-16-2012, 01:04 AM
get value from query and put on controller - by El Forum - 07-16-2012, 02:24 AM
get value from query and put on controller - by El Forum - 07-16-2012, 02:35 AM
get value from query and put on controller - by El Forum - 07-16-2012, 03:10 AM
get value from query and put on controller - by El Forum - 07-16-2012, 06:49 PM
get value from query and put on controller - by El Forum - 07-16-2012, 11:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB