Download the PHP package kaylathedev/dbal without Composer
On this page you can find all versions of the php package kaylathedev/dbal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kaylathedev/dbal
More information about kaylathedev/dbal
Files in kaylathedev/dbal
Package dbal
Short Description A database abstraction library for PHP.
License MIT
Informations about the package dbal
Waffle Systems DAL
A PHP library which provides an abstraction layer for data maniuplation.
Looking for examples, documentation, or crave info? Go to the wiki.
To start using this library, have composer require wafflesystems/dal
.
Note: Despite the repository name, this is a DBAL (Database Abstraction Layer).
This library contains a layer of abstraction to start interacting with your database. If you want something more involved or more abstract, I highly recommend you use wafflesystems/model along with this library.
Crash Course
I will assume you are using MySQL with your existing PHP application.
The presidents
table must have the columns, id
, first_name
, last_name
, born
, and died
.
Import the DAL\MySQLDatabase
, and construct a new MySQLDatabase.
Set the hostname, username, and password.
Create
Gather your data into an array, and create a new entry.
Read
Use find
to find only 1 entry.
We'll be using the condition class to tell the database which entry we'll use.
Use findAll
to find multiple entries.
Update
Put the data into a new array to overwrite the database.
Delete
This will delete all entries that matches the condition.
BE CAREFUL! If the condition is null, or not given, then ALL entries will be deleted!