Download the PHP package manekshms/db2util without Composer

On this page you can find all versions of the php package manekshms/db2util. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db2util

DB2Util

Total Downloads Latest Stable Version

Database utility and query builder for db2

Table of Contents

Requirements

Installation

Install latest version with

Basic Usage

Configuration and connection

Select data

Select all data from table

$db2Util->getQueryBuilder()->table('table_name')->get();

Select data with where condition

$db2Util->getQueryBuilder()->table('table_name')->where('column-name' , 'column-value')->get(); Example:

Select data with multiple column where condition

$db2Util->getQueryBuilder()->table('table_name')->where(['column-name' => 'column-value'])->get(); Example :

Select with where conditions and operators
$db2Util->getQueryBuilder()->table('table_name')->where('column-name', 'operators', 'values')->get();
Example:

Select with where conditions for multiple column check
$db2Util->getQueryBuilder()->table('user')->where([ array of column name operator and value ])->get();

Example:

OR

Select with in operator
$db2Util->getQueryBuilder()->table('user')->where('column-name', 'in', [array of data])->get();

Example:

Select With Limit
$db2Util->getQueryBuilder()->table('table name')->limit(number of records)->get(); Example:

Select with Limit and Offset
$db2Util->getQueryBuilder()->table('table naem')->limit(limit number)->offset( offset number)->get();
Example:

Select with Like Operator

$db2Util->getQueryBuilder()->table('table name')->where('column', 'like', '%expected value%')->get();
Example:

Select with Join

$db2Util->getQueryBuilder()->table('table name')->join('JOIN TABLE NAME', 'table column ', '=', 'table column')->get();
Example:

Generated Sql :

Other join Methods

Select with nested where condition

            $db2Util->getQueryBuilder()
                           ->table('table name')
                           ->where('column name', 'operator' 'value')
                           ->where(function($query){
                                $query->where('column name', 'operator', 'value')
                                    ->orWhere('column name', 'operator', 'value');
                             })
                           ->get()

Example :

Above Example Will generate SQL like

Select with Union and unionAll
$db2Util->getQueryBuilder()->table('table name')->unionAll('query builder instance')->get();

Example :

Above Example generate SQL like

Select with groupby and having

$db2Util->getQueryBuilder()->table('table name')->select('select columns')->groupBy('column')->having('column|aggrigate functions', 'operator', value)->get();

Example :

Above example will generate sql like :

Where Helper method

Where in

$db2Util->getQueryBuilder()->table('table name')->whereIn('column name', ['values'])->get()

Example:

Where not in

$db2Util->getQueryBuilder()->table('table name')->whereNotIn('column name', ['values'])->get()

Example:

Pluck pluck a single column values to a collection $db2Util->getQueryBuilder()->table('table name')->pluck('column name');

Example:

Count number of records in table
$db2Util->getQueryBuilder()->table('table name')->count();

Example:

Max value of column in table
$db2Util->getQueryBuilder()->table('table name')->max('column name');

Example:

Min value of column in table $db2Util->getQueryBuilder()->table('table name')->min('column name');

Example:

Insert data

Insert Single row
$db2Util->getQueryBuilder()->table('table name')->insert(data associative array);

Example:

Insert Multiple row $db2Util->getQueryBuilder()->table('table name')->insert(two dimensional data associative array);
Example:

Update data

Update all records
$db2Util->getQueryBuilder()->table('table name')->update(['column name' => 'new data']);

Example:

update with where conditions

$db2Util->getQueryBuilder()->table('table name')->where('column name', 'data')->update(['column name' => 'new data']);
Example:

incrementing value of column

$db2Util->getQueryBuilder()->table('table name')->increment('column name', increment cound default 1);

Example:

decrementing value of column

$db2Util->getQueryBuilder()->table('table name')->decrement('column name', decrement count default 1);

Example:

Delete data

Delete all data $db2Util->getQueryBuilder()->table('table name')->delete();
Example:

Delete with where conditions
$db2Util->getQueryBuilder()->table('user')->where('column name', 'operant', 'value')->delete();
Example:

Get Last sql query

$db2Util->getConnection()->getLastSQLQuery(debug true or false) if debug is false output will be string

if debug is true output will be associative array with query, params and processed query

For complex query

Execute Query

Query

Author

Maneksh M S - [email protected]


All versions of db2util with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package manekshms/db2util contains the following files

Loading the files please wait ....