How to write query on Model and Call Model using Controller in Codeigniter 4? |
You don't need to write the SQL query. Use findAll like this:
PHP Code: public function all() See the this example: https://codeigniter4.github.io/userguide...your-model Like in CI3, you can return the data as an object or as an array. In CI4 use asArray or asObject: https://codeigniter4.github.io/userguide...pe-changes |
Messages In This Thread |
How to write query on Model and Call Model using Controller in Codeigniter 4? - by msjagan - 09-24-2019, 01:32 AM
RE: How to write query on Model and Call Model using Controller in Codeigniter 4? - by includebeer - 09-29-2019, 07:06 AM
RE: How to write query on Model and Call Model using Controller in Codeigniter 4? - by mohsin khan - 10-01-2019, 01:18 AM
RE: How to write query on Model and Call Model using Controller in Codeigniter 4? - by dave friend - 10-01-2019, 08:35 AM
RE: How to write query on Model and Call Model using Controller in Codeigniter 4? - by msjagan - 11-17-2019, 09:22 PM
|