Download the PHP package silverslice/easydb without Composer

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

EasyDb

Coverage Status

EasyDb is a simple wrapper over standart myslqi extension.

What does this library offer you?

Install

Use composer to install library.

composer require silverslice/easydb

Connect to the database

Placeholders

EasyDb uses placeholders to place data in the query.

Types of placeholders

? - smart

In most cases you can use this placeholder. It automatically detects your value and correctly formats it.

?i - integer

Value will be cast to int with intval function.

?s - string

Value will be escaped with mysqli internal escape function and will be wrapped with single quote.

?f - float

Value will be cast to float with floatval function.

?a - array

This placeholder expects array, correctly escapes and quotes its values, and separates them by comma. It is useful in queries like SELECT * FROM table WHERE id IN (1, 2, 3)

?u - set

This placeholder expects column-value array and generates code for SET clouse

?e - escape

Value will be escaped with mysqli internal escape function.

?p - part

Value will be inserted as is. Use this placeholder to insert already prepared part of sql query.

Make query dinamically

If your query depends on some conditions you can use prepare method to replace all placeholders in string with passed parameters. This string may be inserted into query safely.

Exceptions

EasyDb converts all database errors to \Silverslice\EasyDb\Exception. Use getQuery method to get the query which caused an error.

Example:

Selecting rows

getOne

Peforms query and fetchs first cell from the first result row

Parameters:

Returns:

getAssoc

Peforms query and fetchs first result row as an associative array

Returns:

getAll

Peforms query and fetchs all result rows as an associative array

Returns:

getColumn

Peforms query and fetchs one column from the result set as an enumerate array

Returns:

getPairs

Peforms query and fetchs key-value pairs from the result set.

Returns:

getAllKeyed

Peforms query and fetchs key-values pairs from the result set.

Returns:

Modifying rows

insert

Inserts row into table

Parameters:

Returns:

update

Updates table rows

Parameters:

Returns:

insertUpdate

Inserts or updates table row using INSERT... ON DUPLICATE KEY UPDATE clause

Parameters:

Returns:

multiInsert

Inserts multiple rows into table

Parameters:

Returns:

delete

Deletes table rows

Parameters:

Returns:

Using transactions

beginTransaction

Starts a transaction

commit

Commits the current transaction

rollback

Rolls back current transaction

transaction

Runs code in transaction

Parameters:

Returns:

Throws:

Example:

Advanced

Expressions

Columns in SQL queries are sometimes expressions, not simply column names from a table. You can create an object of type Expression to insert expression into sql.

Multi queries

Use multiQuery method to execute several queries which are concatenated by a semicolon, for example to load sql dump from file.

multiQuery

Executes one or multiple queries which are concatenated by a semicolon

Parameters:

Returns:

Throws:

Example:


All versions of easydb 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 silverslice/easydb contains the following files

Loading the files please wait ....