PHPackages                             cahkampung/landa-db - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. cahkampung/landa-db

ActiveLibrary[Framework](/categories/framework)

cahkampung/landa-db
===================

Mysql POD library

1.3.2(4y ago)18.4k↓30%2AFL-1.1PHPPHP &gt;=5.4

Since Mar 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wahyuagung26/landadb)[ Packagist](https://packagist.org/packages/cahkampung/landa-db)[ RSS](/packages/cahkampung-landa-db/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (14)Used By (0)

Landa DB
========

[](#landa-db)

Simple Mysql PDO CRUD library

Installation
------------

[](#installation)

Install with [Composer](http://getcomposer.org/)

Add `cahkampung/landa-db` to require in composer.json

`"require": { "cahkampung/landa-db": "^1.2" },`

Run `composer install`

How To Use
----------

[](#how-to-use)

### Connection

[](#connection)

```
$config = [
  'DB_DRIVER'      => 'mysql',
  'DB_HOST'        => 'localhost',
  'DB_USER'        => 'root',
  'DB_PASS'        => 'password',
  'DB_NAME'        => 'database',
  'CREATED_USER'   => 'created_by',
  'CREATED_TIME'   => 'created_at',
  'CREATED_TYPE'   => 'int',
  'MODIFIED_USER'  => 'modified_by',
  'MODIFIED_TIME'  => 'modified_at',
  'MODIFIED_TYPE'  => 'int',
  'DISPLAY_ERRORS' => false,
  'USER_ID'        => $_SESSION['user']['id'],
];

$db = new Cahkampung\Landadb($config);

```

### Insert

[](#insert)

`$db->insert(TABLE_NAME, DATA);`

Example :

```
$data = [
  'name' => 'john',
  'email' => 'john@example.com'
];

$db->insert('user_table', $data);

```

### Update

[](#update)

`$db->update(TABLE_NAME, DATA, PARAMS);`

Example :

```
$data = [
  'name' => 'john',
  'email' => 'john@example.com'
];

$db->update('user_table', $data, ['id' => 1]);

```

### Delete

[](#delete)

`$db->delete(TABLE_NAME, PARAMS);`

Example :

```
$db->delete('user_table', ['id' => 1]);

```

### Select

[](#select)

#### select()

[](#select-1)

`select(FIELDS)`

**FIELDS** can be array format, default value is `*`

#### from()

[](#from)

`from(TABLE)`

#### where()

[](#where)

`where(FIELD_NAME, FILTER, VALUE)`

#### andWhere()

[](#andwhere)

`andWhere(FIELD_NAME, FILTER, VALUE)`

#### orWhere()

[](#orwhere)

`andWhere(FIELD_NAME, FILTER, VALUE)`

#### customWhere()

[](#customwhere)

`customWhere(WHERE_STRING, FILTER)`

Default filter is `And`

Example :

`customWhere('name = "john" or nationallity = "indonesia"', 'AND');`

Will generate `AND (name="john" or nationallity="indonesia");`

#### join()

[](#join)

`join(JOIN TYPE, TABLE, ONCLAUSE)`

#### leftJoin()

[](#leftjoin)

`leftJoin(TABLE, ONCLAUSE)`

#### rightJoin()

[](#rightjoin)

`rightJoin(TABLE, ONCLAUSE)`

#### innerJoin()

[](#innerjoin)

`innerJoin(TABLE, ONCLAUSE)`

#### limit()

[](#limit)

`limit(INT)`

#### offset()

[](#offset)

`offset(INT)`

#### orderBy()

[](#orderby)

`orderBy(FIELD)`

#### groupBy

[](#groupby)

`groupBy(FIELD)`

#### findAll()

[](#findall)

Fetch all result from query

Example :

```
$db->findAll('select * from user_table where name like "%john%" order by name ASC limit 10 offset 0');

```

Or

```
$db->select()
    ->from('user_table')
    ->where('name','LIKE','john')
    ->limit(10)
    ->offset(0)
    ->orderBy('name ASC')
$getUsers = $db->findAll();

```

#### find()

[](#find)

Fetch 1 results from query

Example :

```
$db->find('select * from user_table where name like "%john%" order by name ASC');

```

Or

```
$db = new Cahkampung\Landadb;
$db->select()
    ->from('user_table')
    ->where('name','LIKE','john')
    ->orderBy('name ASC')
$getUsers = $db->find();

```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~144 days

Recently: every ~219 days

Total

13

Last Release

1608d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/195414122?v=4)[agung052](/maintainers/agung052)[@agung052](https://github.com/agung052)

---

Top Contributors

[![wahyuagung26](https://avatars.githubusercontent.com/u/7872055?v=4)](https://github.com/wahyuagung26 "wahyuagung26 (23 commits)")

---

Tags

frameworkdatabaseslimpdo

### Embed Badge

![Health badge](/badges/cahkampung-landa-db/health.svg)

```
[![Health](https://phpackages.com/badges/cahkampung-landa-db/health.svg)](https://phpackages.com/packages/cahkampung-landa-db)
```

###  Alternatives

[rubellum/slim-blade-view

Slim Framework 3 view helper built on the Blade component

1822.4k2](/packages/rubellum-slim-blade-view)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
