Download the PHP package solophp/database without Composer

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

Solo Database

Version License

Lightweight and flexible PHP database wrapper with support for multiple database types, query building, and optional logging.

Installation

Features

Requirements

API Reference

Method Arguments Description Return Type
query() string $sql, mixed ...$params Execute a query with placeholders self
prepare() string $sql, mixed ...$params Prepare SQL string without execution string
fetchAll() ?int $fetchMode = null Fetch all rows array<int|string, array|stdClass>
fetch() ?int $fetchMode = null Fetch single row array|stdClass|null
fetchColumn() int $columnIndex = 0 Fetch single column from next row mixed
lastInsertId() Get last inserted ID string|false
rowCount() Get number of affected rows int
beginTransaction() Begin transaction void
commit() Commit transaction void
rollBack() Roll back transaction void
inTransaction() Check if in transaction bool
withTransaction() callable $callback Run logic inside a safe transaction (auto rollback on exception) mixed

Query Placeholders

Placeholder Description
?s String (safely quoted)
?i Integer
?f Float
?a Array (for IN statements)
?A Associative Array (for SET statements)
?t Table name (with prefix)
?c Column name (safely quoted)
?d Date (DateTimeImmutable or null)
?l LIKE condition with wildcards
?M Multi-row INSERT (array of arrays)
?r Raw parameter (unescaped)

Usage

Basic Configuration

Query Examples

Database Support

Date formatting is handled automatically per driver:

Return Types

Method Description Return Type
fetchAll(?int $fetchMode = null) Get all rows array<int|string, array|stdClass>
fetch(?int $fetchMode = null) Get one row array|stdClass|null
fetchColumn(int $columnIndex = 0) Get column from next row mixed
rowCount() Affected rows from last query int
lastInsertId() Last inserted auto-increment ID string|false

Error Handling

License

MIT License. See LICENSE file for details.


All versions of database with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
solophp/logger Version ^v1.0
ext-pdo Version *
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 solophp/database contains the following files

Loading the files please wait ....