• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
db->update blanks out data array values

#1
Has anyone seen this before?
db->update and db->update_string both blank out every value in the data array when producting a query.
This is CI3.  Using PDO driver.  Thanks in advance.

Code:
      $data = array( 'title' => 'one',
                               'description' => 'descone',
                               'shared' => 'yes',
                               'active' => 'yes',
                               'query' => $this->input->get_post("query")
                             );        
        print_r($data);

         $where = "id=1";
         $sql = $this->db->update_string('widgetsdef', $data, $where);          
         echo $sql;

Output:

Array ( [title] => one [description] => descone [shared] => yes [active] => yes [query] => )

UPDATE widgetsdef SET title = '', description = '', shared = '', active = '', query = '' WHERE id = 1
Reply

#2
So, I've confirmed that this is a PDO driver issue, ODBC and MYSQL drivers do not have this problem. Sadly, I gotta have PDO for a very large project that will run on 200+ servers, and I really want to use CI3 for it.

Sorry for not code quoting on the last post, lets see if I get it right this time.
I'd really be interested in hearing from anyone with ideas around this - thanks to the CI community.

<code>
      $data = array( 'title' => 'one',
                               'description' => 'descone',
                               'shared' => 'yes',
                               'active' => 'yes',
                               'query' => $this->input->get_post("query")
                             );        
        print_r($data);

         $where = "id=1";
         $sql = $this->db->update_string('widgetsdef', $data, $where);          
         echo $sql;
</code>

Output:
Array ( [title] => one [description] => descone [shared] => yes [active] => yes [query] => )
UPDATE widgetsdef SET title = '', description = '', shared = '', active = '', query = '' WHERE id = 1
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.