Welcome Guest, Not a member yet? Register   Sign In
SOLVED: How can i use $this->db->insert in CI4?
#1

(This post was last modified: 06-02-2022, 04:58 PM by seighth.)

THIS PROBLEM IS ALREADY SOLVED AND HERE IS HOW I SOLVED IT:


Code:
$db = \Config\Database::connect();
$db->table('table_name')->insert($array));


____________________________________________________________________
Quote:as the title says, I would like to know what is the CI4 version of this because I am using my own MySQL query and not the built in feature of CI4... I have soo many Models from a previous project coming from CI3 that is why I wouldn't want to rewrite all those into CI4 built in Query Builder, I just want to know what is the equivalent version of $this->db->insert('tbl_name', $array) in CI4?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB