Download the PHP package marcel-maqsood/database-connector without Composer

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

Database-Connector | PersistentPDO

You can install this package with the following command:

Configuration

Our Database-Connector has a very easy configuration:

Also, you can either add our PersistentPDO within any of your ConfigProviders or directly inside your applications :

The syntax is the same for ConfigProviders but by adding it into your dependencies, you will always have access to it at any module of your application without thinking about its configuration again.

Functionality:

get():

Fetches data from the database based on specified conditions.

This function constructs and executes a SQL query to retrieve data from the database.

It receives the follwing params:

conditions are getting appended after "WHERE" don't include it.

The first condition should not include a 'logicalOperator' key, as there is no preceding condition to combine with, also it won't get used if defined. Example: string"name = 'test'" this function returns a (field value) or , if no row was found matching your conditions.

getAll():

For further details, see get(); as this method uses the same syntax.

The main difference between get() and getAll() is self explaining: getAll() fetches every row that matches your conditions instead of just the first one.

It returns either or an filled with keys and values where every value is a .

getAllBase()

The main difference between getAll() and getAllBasae() is : getAllBase() requires a SQL string instead of plain table-names, conditions, joins or anything.

This is extremly useful when you need to make edge-case queries like checks for items that are present in one table but not in another as this is not supported by our other functions and thus require custom SQL statements.

Just like getAll() - It returns either or an filled with keys and values where every value is a .

update()

Updates data in the database based on specific conditions.

It receives the follwing params:

This functions returns a bool: the result of the given statement.

insert()

Inserts data in the database based on specific conditions.

It receives the follwing params:

$inserts array is defined like $updates array of update().

This function either returns the ID of the inserted row or false, if there was an issue with the statement.

delete()

Deletes data in the database based on specific conditions.

It receives the follwing params:

This functions returns a bool: the result of the given statement.

Condition Array

As stated earlier, conditions can either be a string (x = y) without appended "WHERE" or a condition array, which can look something like this:

This insures that you can either use simple conditions for only certain cols and tables or even conditions that need to contain some more logic, as: if ´COL´ IS NOT NULL then use ´COL´ otherwise use ´otherCOL´


All versions of database-connector with dependencies

PHP Build Version
Package Version
Requires webmozart/assert Version ^1.11
psr/container 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 marcel-maqsood/database-connector contains the following files

Loading the files please wait ...