Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
CodeIgniter

Select, Insert, Update and Delete in CodeIgniter

Perform core SQL operations with Query Builder: select, insert, update, and delete.

Select, Insert, Update and Delete in CodeIgniter — a practical guide to CodeIgniter CRUD queries with clear examples you can reuse in real projects.

CodeIgniter Tutorial Series (32/74). Prefer one article? Read the complete CodeIgniter tutorial.

Short description

These four operations power most CRUD apps. Prefer Query Builder or Models for everyday work.

CRUD with Query Builder

$builder = $db->table('posts');

$builder->insert(['title' => 'Hello', 'body' => 'World']);
$builder->where('id', 1)->update(['title' => 'Updated']);
$row = $builder->where('id', 1)->get()->getRowArray();
$builder->where('id', 1)->delete();

Leave a reply

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