Skip to content
Advertisement

Tag: codeigniter

How to get the SUM of 3 individual columns in codeigniter

I am trying to get the SUM of 3 individual columns. When I try to output I get nothing. What do I do wrong? Model Controller View Answer $this->db->select() accepts an optional second parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names. This is useful if you need a compound select

How to update multiple records in Codeigniter

In above code snippet first function is declared in controller and second function is declared in model. I want to update owner for multiple rows having ids in $astrep. Can anyone please help me? Answer You can use whereIn() or orWhereIn() methods from query builder class. Refer https://codeigniter4.github.io/userguide/database/query_builder.html#looking-for-specific-data

Advertisement