Download the PHP package maplephp/query without Composer

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

MaplePHP - Database query builder

MaplePHP - Database query builder is a powerful yet user-friendly library for making safe database queries, with support for MySQL, SQLite and PostgreSQL.

Contents

Connect to the database

Connect to MySQL

Connect to SQLite

Connect to PostgreSQL

Note: That the first connection will count as the main connection if not overwritten. You can also have multiple connection, click here for more information.

Make queries

Start with the namespace

Select 1:

Default alias will be the table name e.g. users and login if they were not overwritten.

Select 2:

Where 1

Where 2

"compare", "or"/"and" and "not".

Where 3

Where 4

Having

Having command works the same as where command above with exception that you rename "where" method to "having" and that the method "havingBind" do not exist.

Limit

Order

Join

Note that no value in the join is, by default, enclosed. This means it will not add quotes to strings. This means it will attempt to add a database column by default if it is a string, and will return an error if the string column does not exist. If you want to enclose the value with quotes, use Attributes (see the section below).

Pluck

Insert

Update on duplicate

Will update row if primary key exist else Insert

Update

Delete

Set

Preview SQL code before executing

Attributes

Each value is automatically escaped by default in the most effective manner to ensure consequential and secure data storage, guarding against SQL injection vulnerabilities. While it's possible to exert complete control over SQL input using various Raw methods, such an approach is not advisable due to the potential for mistakes that could introduce vulnerabilities. A safer alternative is to leverage the Attr class. The Attr class offers comprehensive configuration capabilities for nearly every value in the DB library, as illustrated below:

Escape values and protect against SQL injections

Example:

Enable/disable string enclose

Example:

Enable/disable XSS protection

Some like to have the all the database data already HTML special character escaped.

Example:

Automatically json encode array data

A pragmatic function that will automatically encode all array input data to a json string

Example:

The default values vary based on whether it is a table column, a condition in a WHERE clause, or a value to be set. For instance, if expecting a table columns, the default is not to enclose value with quotes, whereas for WHERE or SET inputs, it defaults is to enclose the values. Regardless, every value defaults to prep, encode and jsonEncode being set to true.

Multiple connections

You can have multiple connection to different MySQL or SQLite databases or both.


All versions of query with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
maplephp/dto Version ^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 maplephp/query contains the following files

Loading the files please wait ....