Download the PHP package axisstudios/db-record without Composer

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

DbRecord

Introduction

DbRecord is a library that allows us to operate databases without manually execute SQL statements. Unlike other similar libraries, DbRecord allows us to operate on multiple tables at the same time, resulting in a more concise and clear code.

Installation

This package is provided via composer package manager. Just create a composer.json file and execute the following command in the same directory:

See Basic Usage for more info.

Database requirements

This library can operate any MySQL database, with the only condition that each table MUST have a primary key composed by a single auto-increment column. By default, the primary key is called ID, but you can change it from the constructor.

Basic examples: insert(), update(), select() and delete()

We use the DbRecordTable class to perform basic operations.

Inserting records

To insert records, we ommit the id parameter from the constructor:

Updating records

Updates the record ID=1:

Inserting/Updating records

You can insert or update a record in the same line. For example:

Selecting records

Selects the record ID=1:

Deleting records

Delete the record ID=1:

For a more complex example see test1.php.

General example: Accessing several tables at the same time

Let's say that we have a main table (table0) and three secondary tables (table1, table2 and table3). The three tables are 'left joined' to the main table through the columns table1_id, table2_id and table3_id. That is: test

Instead of operating on tables individually, we can do it at the same time. The following example selects a record (ID = 1) and updates or inserts records on table1, table2 and table3:

The following example selects a record (ID = 1) and retrieves columns from table0, table1, table2 and table3 at the same time:

For a more complex example see test2.php.

Column path expressions

In the previous examples we accessed the title column of table1 through the following expression: table1.title. The general format is as follows:

We can omit id and table0_id, as they are taken by default. So the previous expression can by simplified as follows:

Let's imagine a more complex example. Let's say that table2 depends on table1 which, at the same time, depends on table0. That is:

test1

In that case, we use the following code to access the table1 and table2 columns:

The previous expressios are simplified versions of the general expressions:

We can omit id and <table>_id, as they are taken by default.

For more complex examples see test5.php


All versions of db-record with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
soloproyectos-php/db Version ~1.1
soloproyectos-php/array Version ~1.0
soloproyectos-php/text 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 axisstudios/db-record contains the following files

Loading the files please wait ....