Download the PHP package cahkampung/landa-db without Composer
On this page you can find all versions of the php package cahkampung/landa-db. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cahkampung/landa-db
More information about cahkampung/landa-db
Files in cahkampung/landa-db
Informations about the package landa-db
Landa DB
Simple Mysql PDO CRUD library
Installation
Install with Composer
Add cahkampung/landa-db
to require in composer.json
"require": { "cahkampung/landa-db": "^1.2" },
Run composer install
How To Use
Connection
Insert
$db->insert(TABLE_NAME, DATA);
Example :
Update
$db->update(TABLE_NAME, DATA, PARAMS);
Example :
Delete
$db->delete(TABLE_NAME, PARAMS);
Example :
Select
select()
select(FIELDS)
FIELDS can be array format, default value is *
from()
from(TABLE)
where()
where(FIELD_NAME, FILTER, VALUE)
andWhere()
andWhere(FIELD_NAME, FILTER, VALUE)
orWhere()
andWhere(FIELD_NAME, FILTER, VALUE)
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 TYPE, TABLE, ONCLAUSE)
leftJoin()
leftJoin(TABLE, ONCLAUSE)
rightJoin()
rightJoin(TABLE, ONCLAUSE)
innerJoin()
innerJoin(TABLE, ONCLAUSE)
limit()
limit(INT)
offset()
offset(INT)
orderBy()
orderBy(FIELD)
groupBy
groupBy(FIELD)
findAll()
Fetch all result from query
Example :
Or
find()
Fetch 1 results from query
Example :
Or
All versions of landa-db with dependencies
ext-pdo Version *