Values in a function getting Nullified when calling SQL insert query |
Hi Team
i am running into a weird problem. I have created a function to insert some data into the database. i am getting the values to be inserted from Angular. unless the insert or query function is called ($this->db->insert('table_name', $data_array), i can see all the values coming to the function correctly and i can also print those values but as soon as i call the insert / query function and i run the code, the values are showing NULL or 0. Could somebody please help me on this issue. Code: public function course_landing_page_data($courseTitle, $courseSubTitle, $ins_id) { appreciate your help
@vinugenie,
You should use query binding ( https://www.codeigniter.com/user_guide/d...y-bindings ) and batch inserts [$this->db->insert_batch()]( https://www.codeigniter.com/user_guide/d...rting-data ). If you use these features then CI will automatically escape all values for you. PHP Code: EXAMPLE: |
Welcome Guest, Not a member yet? Register Sign In |