Download the PHP package dmitryproa/php-advanced-querying without Composer

On this page you can find all versions of the php package dmitryproa/php-advanced-querying. 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 php-advanced-querying

PHP Advanced Querying

A PHP library for building and formatting complex SQL queries. Tested on PHP 7.1 and PHP 7.4.

Example

Result:

Table of contents

1. Installation ↑

The recommended way to install this library is through Composer. Run the following command to install it: composer require dmitryproa/php-advanced-querying

2. Syntax ↑

2.1 Builder ↑

Class QueryBuilder provides the following methods for building a statement:

2.2 Table ↑

Table specified as follows:

2.3 Select columns ↑

Select columns are pairs of alias (optional) and expression, and defined as associative array:

2.4 Update values ↑

Update values are pairs of a column and an expression, and defined the same way as columns:

2.5 Insert fields ↑

Insert fields are plain strings:

2.6 Insert values ↑

One- or two-dimensional array of literals:

2.7 Expressions ↑

2.7.1 Column expression ↑

2.7.2 Literal expression ↑

2.7.3 Select expression ↑

2.7.4 Function expression ↑

There are several pre-defined functions:

2.8 Statements ↑

Every statement have a setTable($table) method.

2.8.1 Conditional (WHERE) statements ↑

Some statements (such as SELECT, UPDATE and DELETE) can specify WHERE conditions:

Conditions can also be defined using helper functions: true(), false(), eq(), notEq(), greater(), greaterEquals(), less(), lessEquals(), like(), notLike(), isNull(), isNotNull(), in(), notIn(), and_() and or_(). For example:

Conditions can be used as expressions:

2.8.2 JOIN statements ↑

Select and Update statements have a join() method:

Available join types: Join::OUTER, Join::INNER, Join::LEFT, Join::RIGHT.

2.8.3 SELECT statement ↑

Select statement have following methods:

Select statement can use another Select as table, for example:

UNION SELECT statement can be made by calling an unionSelect() functions, which returns a new SELECT. For example:

2.8.4 UPDATE statement ↑

Update statement have the following methods:

2.8.5 INSERT and REPLACE statements ↑

These statements have the following methods:

INSERT statement also have the following methods:

2.8.6 INSERT... SELECT and REPLACE... SELECT statements ↑

These statements have the following methods:

InsertSelect statement also have ignore() and onDuplicateKeyUpdate() methods.


All versions of php-advanced-querying with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
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 dmitryproa/php-advanced-querying contains the following files

Loading the files please wait ....