Skip to content
Advertisement

How to get specific columns in CodeIgniter 4?

I wanna select specific columns from table. Not all columns.

JavaScript

I’m using this but it returns all data.

Advertisement

Answer

According to the CI4 query builder documentation you can use select() in this way:

JavaScript

where() could be possible to use in 4 ways, you can choose.

This stuff should be placed in Model file, method of which would return $query set of DB data.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement