Advertisement
Guest User

Codeigniter problem

a guest
Nov 26th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. What is the problem with this codeigniter
  2. I am passing this array
  3.        
  4.         Array
  5.         (
  6.             [vrnoa] => 6
  7.             [vrdate] => 2013/11/26
  8.             [party_id_co] => Rearmsa asdf
  9.             [remarks] => Remarks go here
  10.             [etype] => navigation
  11.         )
  12.    
  13.     to the function:
  14.    
  15.         public function saveStockMain($data)
  16.         {
  17.             $this->db->where('vrnoa',$data['vrnoa']);
  18.             $q = $this->db->get('StockMain');
  19.    
  20.             if ( $q->num_rows() > 0 ) {
  21.                 $this->db->where('vrnoa',$data['vrnoa']);
  22.                 $this->db->update('StockMain',$data);
  23.             }
  24.             else {
  25.                 $this->db->insert('StockMain',$data);
  26.             }
  27.         }
  28.  
  29. And it keeps inserting 0 at the party_id_co column in the database, while there isn't 0 in the array that I have passed, there is "Rearmsa asdf".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement