CRUD Query in CodeIgniter 4

You can find Database Query for CRUD operation in  CodeIgniter 4 below.

  • SELECT query in CodeIgniter 4
  • INSERT query in CodeIgniter 4
  • UPDATE query in CodeIgniter 4
  • DELETE query in CodeIgniter 4

 

SELECT

For Number of rows you can use ‘$result->get()->getNumRows();‘ butit will return 1 record more because of ‘$result->get()->getResult();
You can use only one of them ‘$result->get()->getNumRows();‘ OR ‘$result->get()->getResult();‘ for better result.

So, it’s preferred to use ‘count($record);‘ for number of rows.

 

INSERT

 

UPDATE

 

DELETE

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *