Welcome Guest, Not a member yet? Register   Sign In
Updating data on another DB - is that possible?
#6

[eluser]Karman de Lange[/eluser]
[quote author="red2034" date="1392487397"]So now that I have access to multiple DBs (default, platform) this is what I would like to do:

Code:
public function index()
    {
  $course_id = '18896';
        if ($this->session->userdata('student_login') != 1)
            redirect(base_url() . 'index.php?login', 'refresh');
        if ($this->session->userdata('student_login') == 1)
$this->db_platform = $this->CI->load->database('platform', TRUE);  
$class_status = $this->db_platform->get_where('class' , array('status' => 'not attempted'))->row_array();
     $data['status'] = 'in-progress';
            
            $this->db_platform->update('status', $data);
   redirect(base_url() . 'index.php?student/dashboard', 'refresh');
  
    }

I am trying to change the 'status' data to 'in-progress' but it is not updating...

Anybody see my error?[/quote]

This $this->db_platform->update('status', $data); will update all rows your status table to 'in-progress' , you need a where clause to limit it to 1 row (if that is the intention).

Are you getting any errors or what is the issue?

L:


Messages In This Thread
Updating data on another DB - is that possible? - by El Forum - 02-15-2014, 09:36 AM
Updating data on another DB - is that possible? - by El Forum - 02-15-2014, 09:50 AM
Updating data on another DB - is that possible? - by El Forum - 02-15-2014, 11:03 AM
Updating data on another DB - is that possible? - by El Forum - 02-15-2014, 11:29 AM
Updating data on another DB - is that possible? - by El Forum - 02-15-2014, 11:52 AM
Updating data on another DB - is that possible? - by El Forum - 02-16-2014, 12:31 AM
Updating data on another DB - is that possible? - by El Forum - 02-16-2014, 09:15 AM
Updating data on another DB - is that possible? - by El Forum - 02-16-2014, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB