Download the PHP package modularr/database without Composer

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

Database

An easy to use class for Database queries in PHP.

API

See Below for usage.

Connections

This class lets you connect to PDO whichever way you choose, This maximizes flexibility by letting you simply give us your already existing object, or by using our class as your primary Database package and asking for the PDO object if you need to pass it to other libraries.

Connection Syntax

You can connect using multiple syntax to make it easy to use, available both in the __construct() as well as connect()

You can either use an associative array or the default which uses reverse order to let you define the most important values first, and lets you default irrelevant values such as host or type to it's defaults ('mysql' and 'localhost')

Via Instantiation

Via Method

Via Existing PDO Object

Usage and Use Case

A facade is optional but has all the same functionality of the main class.

Regular Use Case

Facades Use Case

Create Facade from PDO Object

Connect Via Facade

Use Case

Query

This is a query with bind parameters. First argument is the statement, second argument is an array of parameters (optional)

Note: We passed the query into a variable for later re-use.

Quote

Escaping in PDO adds quotes around the escaped string, which is an issue if you try doing a LIKE query:

PDO does not provide a way to turn off quotes around escaped strings so, we created a function that simply removes the quotes (first and last characters). This returns a string similar to the old mysql_real_escape_string function.

Please note that this requires you to start adding quotes yourself. Escaping is the default when you bind parameters in PDO. As such, escaping is turned on by default as per the original function (passthrough).

Fetch and Safe Fetch

This is regular returned object. You still need to apply htmlspecialchars yourself.

This is safe returned object. htmlspecialchars is applied to all the objects's properties.

Num Rows

Data Examples

Installation

via Composer:

composer require modularr/database

Or install like so:

Manual:

  1. Download Release Or copy file manually
  2. Include Main.php found under src/ (this includes both Database.php and Facade.php)

All versions of database with dependencies

PHP Build Version
Package Version
No informations.
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 modularr/database contains the following files

Loading the files please wait ....