https://github.com/mbah-dhaim/libcsi
simple database and query builder library
https://github.com/mbah-dhaim/libcsi
model mysql-database pdo php
Last synced: about 1 month ago
JSON representation
simple database and query builder library
- Host: GitHub
- URL: https://github.com/mbah-dhaim/libcsi
- Owner: mbah-dhaim
- Created: 2017-08-24T11:12:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-05T22:29:24.000Z (over 7 years ago)
- Last Synced: 2025-01-30T04:26:45.578Z (3 months ago)
- Topics: model, mysql-database, pdo, php
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# libcsi
Simple library for connecting database and create query builder model
version **dev-master**
* only support **mysql/mariadb** syntax## installatation
It's recommended that you use [Composer](https://getcomposer.org/) to install
```bash
$ composer require libcsi/libcsi "dev-master"
```**OR**
* create composer.json containing
```javascript
{
"minimum-stability": "dev",
"require": {
"php": ">=5.3.0",
"libcsi/libcsi": "dev-master"
}
}
```
* run `composer install`
## usage example
```php
array (
'dbdriver' => 'mysql',
'dbserver' => 'localhost',
'dbname' => 'dbname',
'dbuser' => 'dbuser',
'dbpass' => 'dbpass'
)
);
$db = new \CSI\Data\DataAdapter ( $config ["DB"] );
try{
// connect to database
$db->connect();
}catch(\Exception $e){
die($e->getMessage());
}
```
### example model
```php
find("a primary key value");
$fieldvalue = $table->afiedname;
```
That's it