Welcome Guest, Not a member yet? Register   Sign In
database problem, and really searching for a fix
#2

[eluser]Unknown[/eluser]
Hi Guys,

I have solved this problem, not by extending the CI_DB_driver class but by extracting the array and extra using the $this->db->set() function with a preg_match on the value from the array.

Here my sollution:
Code:
foreach($dataArray as $kolumn => $value) {
                if(preg_match("/select (.*) from (.*)/i", trim($value)) > 0){
                    $this->db->set($kolumn, $value, FALSE);
  }else{
                    $this->db->set($kolumn, $value);
                }
            }
// $tablename was previously declared by the masterArray
$this->db->insert($tablename);



Messages In This Thread
database problem, and really searching for a fix - by El Forum - 09-06-2012, 03:21 PM
database problem, and really searching for a fix - by El Forum - 09-07-2012, 01:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB