-
Notifications
You must be signed in to change notification settings - Fork 286
Installation
Damien edited this page Aug 30, 2019
·
8 revisions
The following instructions outlines how to get started with ezSQL. From here it is recommended to check out the detailed examples.
Note: Composer is required for version 4. Head to the composer website if you don't already have it installed.
composer require ezsql/ezsql
Default initialization
<?php
require 'vendor/autoload.php'; // Needed to load composer autoloader
use ezsql\Database; // Load ezSQL Database Class
$db = Database::initialize('****', [user, password, database, other settings], **optional tag);You can also initialize your database with the following alternative initialization
<?php
require 'vendor/autoload.php'; // Needed to load composer autoloader
use ezsql\Config; // Load ezSQL Config Class
use ezsql\Database\ez_****; // Load ezSQL driver Class
$settings = new Config('****', [user, password, database, other settings]);
$db = new ez_****($settings);Note: **** is one of mysqli, pgsql, sqlsrv, sqlite3, or pdo.
Note: Composer is not required for version 3.x, but it is recommended.
composer require ezsql/ezsql=^3.1.2
Default initialization Using Composer
<?php
require 'vendor/autoload.php'; // Needed to load composer autoloader
$db = new ezSQL_****(user, password, database, or, other settings);Alternative initialization manually downloading
Manually download https://github.com/ezSQL/ezSQL/archive/v3.zip and extract.
<?php
require 'ez_sql_loader.php'; // Require path to where you extracted your ezSQL v3 file
$db = new ezSQL_****(user, password, database, or, other settings);Note: **** is one of mysqli, pgsql, sqlsrv, sqlite3, or pdo.