Welcome Guest, Not a member yet? Register   Sign In
Using $this->input->post in a SQL Query Update
#5

[eluser]internut[/eluser]
Derek,

As you wrote this i was re-doing things and on the same page as you I believe. I did this:

Code:
$data = array(
                  'admin_name' => $this->input->post(admin_name),
                  'admin_email' => $this->input->post(admin_email),
                  'admin_username' => $this->input->post(admin_username),
                  'admin_password' => $this->input->post(admin_password),
                  'admin_url' => $this->input->post(admin_url),
                  'install_url' => $this->input->post(install_url)
               );

               $data = $this->db->escape_str($data);

               $this->db->query("UPDATE settings SET setting='$data[admin_name]' WHERE name='admin_name'");
               $this->db->query("UPDATE settings SET setting='$data[admin_email]' WHERE name='admin_email'");
               $this->db->query("UPDATE settings SET setting='$data[admin_username]' WHERE name='admin_username'");
               $this->db->query("UPDATE settings SET setting='$data[admin_url]' WHERE name='admin_url'");
               $this->db->query("UPDATE settings SET setting='$data[install_url]' WHERE name='install_url'");

               $this->session->set_flashdata('sys_message', 'General Settings:  Updated');  // set system message

Look ok?

wonder if i shoulduse the db update of CI?


Messages In This Thread
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:07 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:12 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:20 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:41 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 12:46 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 01:02 PM
Using $this->input->post in a SQL Query Update - by El Forum - 07-18-2008, 01:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB