PHP Classes
elePHPant
Icontem

Simple MySQLi Class: MySQL access abstraction layer using MySQLi

Recommend this page to a friend!
  Info   View files Documentation   View files View files (43)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-12-15 (2 days ago) RSS 2.0 feedStarStarStarStar 64%Total: 522 This week: 32All time: 5,507 This week: 12Up
Version License PHP version Categories
simple-mysqli 3.0.39MIT/X Consortium ...5.3PHP 5, Databases
Collaborate with this project Author

simple-mysqli - github.com

Description

This package is a simple MySQL access abstraction layer using MySQLi.

It provides a main class that works as a singleton and can establish database connections and execute regular queries or execute common queries using parameters that define tables, fields, values and conditions.

It also provides classes for outputting debug information, manipulate prepared queries, and retrieve query results.

Recommendations

php class file for InnoDB having the transaction handling
Mysql Innodb connection handling in PHP

  Performance   Level  
Name: Lars Moelleken <contact>
Classes: 17 packages by
Country: Germany Germany
Age: 30
All time rank: 133084 in Germany Germany
Week rank: 7 Up1 in Germany Germany Up
Innovation award
Innovation award
Nominee: 8x

Details

Build Status Coverage Status Scrutinizer Code Quality Codacy Badge SensioLabsInsight Dependency Status Latest Stable Version Total Downloads Latest Unstable Version PHP 7 ready License

Simple MySQLi Class

This is a simple MySQL Abstraction Layer compatible with PHP 7+ that provides a simple and _secure_ interaction with your database using mysqli_* functions at its core. This is perfect for small scale applications such as cron jobs, facebook canvas campaigns or micro frameworks or sites.

Get "Simple MySQLi"

You can download it from here, or require it using composer.

  {
      "require": {
        "voku/simple-mysqli": "6.*"
      }
  }

Install via "composer require"

  composer require voku/simple-mysqli

Starting the driver

  use voku\db\DB;

  require_once 'composer/autoload.php';

  $db = DB::getInstance('yourDbHost', 'yourDbUser', 'yourDbPassword', 'yourDbName');
  
  // example
  // $db = DB::getInstance('localhost', 'root', '', 'test');

Multiton && Singleton

You can use `DB::getInstance()` without any parameters and you will get your (as "singleton") first initialized connection. Or you can change the parameter and you will create an new "multiton"-instance which works like an singleton, but you need to use the same parameters again, otherwise (without the same parameter) you will get an new instance.

Using the "DB"-Class

There are numerous ways of using this library, here are some examples of the most common methods.

Selecting and retrieving data from a table

  use voku\db\DB;
  
  $db = DB::getInstance();
  
  $result = $db->query("SELECT * FROM users");
  $users  = $result->fetchAll();

But you can also use a method for select-queries:

  $db->select(string $table, array $where); // generate an SELECT query

Example: SELECT

  $where = array(
      'page_type ='         => 'article',
      'page_type NOT LIKE'  => '%123',
      'page_id >='          => 2,
  );
  $articles = $db->select('page', $where);
  
  echo 'There are ' . count($articles) . ' article(s):' . PHP_EOL;
  
  foreach ($articles as $article) {
      echo 'Type: ' . $article['page_type'] . PHP_EOL;
      echo 'ID: ' . $article['page_id'] . PHP_EOL;
  }

Here is a list of connectors for the "WHERE"-array: 'NOT', 'IS', 'IS NOT', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN', 'LIKE', 'NOT LIKE', '>', '<', '>=', '<=', '<>'

INFO: use an array as $value for "[NOT] IN" and "[NOT] BETWEEN"

Example: SELECT with "NOT IN"

  $where = array(
      'page_type NOT IN'     => array(
          'foo',
          'bar'
      ),
      'page_id >'            => 2,
  );
  $resultSelect = $db->select('page', $where);

Example: SELECT with Cache

  $resultSelect = $db->execSQL("SELECT * FROM users", true, 3600);

The result (via $result->fetchAllArray()) is only cached for 3600s when the query was a SELECT statement, otherwise you get the default result from the `$db->query()` function.

Inserting data on a table

to manipulate tables you have the most important methods wrapped, they all work the same way: parsing arrays of key/value pairs and forming a safe query

the methods are:

  $db->insert( string $table, array $data );                // generate an INSERT query
  $db->replace( string $table, array $data );               // generate an REPLACE query
  $db->update( string $table, array $data, array $where );  // generate an UPDATE query
  $db->delete( string $table, array $where );               // generate a DELETE query

All methods will return the resulting mysqli_insert_id() or true/false depending on context. The correct approach if to always check if they executed as success is always returned

Example: DELETE

  $deleteArray = array('user_id' => 9);
  $ok = $db->delete('users', $deleteArray);
  if ($ok) {
    echo "user deleted!";
  } else {
    echo "can't delete user!";
  }

note: all parameter values are sanitized before execution, you don\'t have to escape values beforehand.

Example: INSERT

  $insertArray = array(
    'name'   => "John",
    'email'  => "johnsmith@email.com",
    'group'  => 1,
    'active' => true,
  );
  $newUserId = $db->insert('users', $insertArray);
  if ($newUserId) {
    echo "new user inserted with the id $new_user_id";
  }

Example: REPLACE

  $replaceArray = array(
      'name'   => 'lars',
      'email'  => 'lars@moelleken.org',
      'group'  => 0
  );
  $tmpId = $db->replace('users', $replaceArray);

Binding parameters on queries

Binding parameters is a good way of preventing mysql injections as the parameters are sanitized before execution.

  $sql = "SELECT * FROM users 
    WHERE id_user = :id_user
    AND active = :active
    LIMIT 1
  ";
  $result = $db->query($sql, array('id_user' => 11, 'active' => 1));
  if ($result) {
    $user = $result->fetchArray();
    print_r($user);
  } else {
    echo "user not found";
  }

Transactions

Use begin(), commit(), and rollback() to manage transactions:

$db->beginTransaction();

$db->query(
    'UPDATE `users` SET `foo` = :foo WHERE id = :id',
    array('foo' => 100, 'id' => 1)
);
$db->query(
    'UPDATE `users_noop` SET `foo` = :foo WHERE id = :id',
    array('foo' => 100, 'id' => 2)
);

$db->endTransaction();

Any SQL errors between begin() and commit() will yield a RuntimeException.

You can also use the DB->transact() method. The following is equivalent to the above:

$db->transact(function($db) {
    $db->query(
        'UPDATE `users` SET `foo` = :foo WHERE id = :id',
        array('foo' => 100, 'id' => 1)
    );
    $db->query(
        'UPDATE `users_noop` SET `foo` = :foo WHERE id = :id',
        array('foo' => 100, 'id' => 2)
    );
});

Using the "Result"-Class

After executing a SELECT query you receive a Result object that will help you manipulate the resultant data. there are different ways of accessing this data, check the examples bellow:

Fetching all data

  $result = $db->query("SELECT * FROM users");
  $allUsers = $result->fetchAll();

Fetching all data works as object, array or Arrayy the fetchAll() method will return the default based on the $_default_result_type config. Other methods are:

  $row = $result->fetch();        // fetch an single result row as defined by the config (array, object or Arrayy)
  $row = $result->fetchArray();   // fetch an single result row as array
  $row = $result->fetchObject();  // fetch an single result row as object
  
  $data = $result->fetchAll();        // fetch all result data as defined by the config (array, object or Arrayy)
  $data = $result->fetchAllArray();   // fetch all result data as array
  $data = $result->fetchAllObject();  // fetch all result data as object
  
  $data = $result->fetchColumn(string $column, bool $skipNullValues);    // fetch a single column as string
  $data = $result->fetchAllColumn(string $column, bool $skipNullValues); // fetch a single column as an 1-dimension array
  $data = $result->fetchArrayPair(string $key, string $value);           // fetch data as a key/value pair array

Fetching database-table-fields

Returns rows of field information in a result set:

$fields = $result->fetchFields();

Pass true as argument if you want each field information returned as an associative array instead of an object. The default is to return each as an object, exactly like the mysqli_fetch_fields function.

Fetching + Callable

Fetches a row or a single column within a row:

$data = $result->fetch($row_number, $column);

This method forms the basis of all fetch_ methods. All forms of fetch_ advances the internal row pointer to the next row. null will be returned when there are no more rows to be fetched.

Fetching + Transpose

Returns all rows at once, transposed as an array of arrays:

$plan_details = $plans->fetchTranspose();

Transposing a result set of X rows each with Y columns will result in an array of Y rows each with X columns.

Pass a column name as argument to return each column as an associative array with keys taken from values of the provided column. If not provided, the keys will be numeric starting from zero.

e.g.:

$transposedExample = array(
  'title' => array(
    1 => 'Title #1',
    2 => 'Title #2',
    3 => 'Title #3',
  )
);

Fetching + Pairs

Returns all rows at once as key-value pairs using the column in the first argument as the key:

$countries = $result->fetchPairs('id');

Pass a column name as the second argument to only return a single column as the value in each pair:

$countries = $result->fetchPairs('id', 'name');

/*
array(
  1 => 'Title #1',
  2 => 'Title #2',
  3 => 'Title #3',
)
*/

Fetching + Groups

Returns all rows at once as a grouped array:

$students_grouped_by_gender = $result->fetchGroups('gender');

Pass a column name as the second argument to only return single columns as the values in each groups:

$student_names_grouped_by_gender = $result->fetchGroups('gender', 'name');

Fetching + first

Returns the first row element from the result:

$first = $result->first();

Pass a column name as argument to return a single column from the first row:

$name = $result->first('name');

Fetching + last

Returns the last row element from the result:

$last = $result->last();

Pass a column name as argument to return a single column from the last row:

$name = $result->last('name');

Fetching + slice

Returns a slice of rows from the result:

$slice = $result->slice(1, 10);

The above will return 10 rows skipping the first one. The first parameter is the zero-based offset; the second parameter is the number of elements; the third parameter is a boolean value to indicate whether to preserve the keys or not (optional and defaults to false). This methods essentially behaves the same as PHP's built-in array_slice() function.

Fetching + map

Sets a mapper callback function that's used inside the Result->fetchCallable() method:

$result->map(function($row) {
    return (object) $row;
});
$object = $result->fetchCallable(0);

The above example will map one row (0) from the result into a object. Set the mapper callback function to null to disable it.

Fetching + aliases

  $db->get()                  // alias for $db->fetch();
  $db->getAll()               // alias for $db->fetchAll();
  $db->getObject()            // alias for $db->fetchAllObject();
  $db->getArray()             // alias for $db->fetchAllArray();
  $db->getArrayy()            // alias for $db->fetchAllArrayy();
  $db->getColumn($key)        // alias for $db->fetchColumn($key);

Fetching + Iterations

To iterate a result-set you can use any fetch() method listed above.

  $result = $db->select('users');

  // using while
  while ($row = $result->fetch()) {
    echo $row->name;
    echo $row->email;
  }

  // using foreach (v1)
  foreach($result->fetchAll() as $row) {
    echo $row->name;
    echo $row->email;
  }
  
  // using foreach (v2)
  foreach($result as $row) {
    echo $row->name;
    echo $row->email;
  }
  
  // INFO: "while + fetch()" will use less memory that "foreach + "fetchAll()", because we will fetch each result entry seperatly

Using the "Prepare"-Class

Prepare statements have the advantage that they are built together in the MySQL-Server, so the performance is better.

But the debugging is harder and logging is impossible (via PHP), so we added a wrapper for "bind_param" called "bind_param_debug". With this wrapper we pre-build the sql-query via php (only for debugging / logging). Now you can e.g. echo the query.

INFO: You can still use "bind_param" instead of "bind_param_debug", e.g. if you need better performance.

INSERT-Prepare-Query (example)

  use voku\db\DB;
  
  $db = DB::getInstance();
  
  // ------------- 
  // prepare the queries
  
  $query = 'INSERT INTO users
    SET 
      name = ?, 
      email = ?
  ';
  
  $prepare = $db->prepare($query);
  
  $name = '';
  $email = '';
  
  $prepare->bind_param_debug('ss', $name, $email);
  
  // -------------
  // execute query no. 1
  
  // INFO: "$template" and "$type" are references, since we use "bind_param" or "bind_param_debug" 
  $name = 'name_1_?';
  $email = 'foo@bar.com';
  
  $prepare->execute();
  
  // DEBUG
  echo $prepare->get_sql_with_bound_parameters();
  
  // -------------
  // execute query no. 2
  
  // INFO: "$template" and "$type" are references, since we use "bind_param" or "bind_param_debug"  
  $name = 'Lars';
  $email = 'lars@moelleken.org';
  
  $prepare->execute();
  
  // DEBUG
  echo $prepare->get_sql_with_bound_parameters();

SELECT-Prepare-Query (example)

  use voku\db\DB;
  
  $db = DB::getInstance();
  
  // -------------
  // insert some dummy-data, first
  
  $data = array(
      'page_template' => 'tpl_test_new123123',
      'page_type'     => '\'"',
  );

  // will return the auto-increment value of the new row
  $resultInsert[1] = $db->insert($this->tableName, $data);
  $resultInsert[2] = $db->insert($this->tableName, $data);

  // ------------- 
  // prepare the queries

  $sql = 'SELECT * FROM ' . $this->tableName . ' 
    WHERE page_id = ?
  ';

  $prepare = $this->db->prepare($sql);
  $page_id = 0;
  $prepare->bind_param_debug('i', $page_id);

  // ------------- 
  // execute query no. 1

  $page_id = $resultInsert[1];
  $result = $prepare->execute();
  $data = $result->fetchArray();

  // $data['page_template'] === 'tpl_test_new123123'
  // $data['page_id'] === $page_id

  // ------------- 
  // execute query no. 2

  $page_id = $resultInsert[2];
  $result = $prepare->execute();
  $data = $result->fetchArray();

  // $data['page_id'] === $page_id
  // $data['page_template'] === 'tpl_test_new123123'

Using the "ActiveRecord"-Class (OOP database-access)

A simple implement of active record pattern via Arrayy.

setDb(DB $db)

set the DB connection.

  $db = DB::getInstance('YOUR_MYSQL_SERVER', 'YOUR_MYSQL_USER', 'YOUR_MYSQL_PW', 'YOUR_DATABASE');
  ActiveRecord::setDb($db);

insert() : boolean|int

This function can build insert SQL queries and can insert the current record into database. If insert was successful, it will return the new id, otherwise it will return false or true (if there are no dirty data).

  $user = new User();
  $user->name = 'demo';
  $user->password = password_hash('demo', PASSWORD_BCRYPT, array("cost"=>15));
  $user_id = $user->insert();
  
  var_dump($user_id); // the new id 
  var_dump($user->id); // also the new id 
  var_dump($user->getPrimaryKey()); // also the new id 

fetch(integer $id = null) : boolean|\ActiveRecord

This function can fetch one record and assign in to current object, otherwise it will return "false". If you call this function with the $id parameter, it will fetch records by using the current primary-key-name.

  $user = new User();

  $user->notnull('id')->order('id desc')->fetch();
  
  // OR //
  
  $user->fetch(1);
  
  // OR //
  
  $user->fetchById(1); // thows "FetchingException" if the ID did not exists
  
  // OR //
  
  $user->fetchByIdIfExists(1); // return NULL if the ID did not exists
  
  var_dump($user->id); // (int) 1
  var_dump($user->getPrimaryKey()); // (int) 1

fetchAll() : $this[]

This function can fetch all records in the database and will return an array of ActiveRecord objects.

  $user = new User();

  $users = $user->fetchAll();
  
  // OR //
  
  $users = $user->fetchByIds(array(1));
  
  // OR //
  
  $users = $user->fetchByIdsPrimaryKeyAsArrayIndex(array(1));
    
  var_dump($users[0]->id) // (int) 1
  var_dump($users[0]->getPrimaryKey()); // (int) 1

update() : boolean|int

This function can build update SQL queries and can update the current record in database, just write the dirty data into database. If update was successful, it will return the affected rows as int, otherwise it will return false or true (if there are no dirty data).

  $user = new User();
  $user->notnull('id')->orderby('id desc')->fetch();
  $user->email = 'test@example.com';
  $user->update();

delete() : boolean

This function can delete the current record in the database.

Active Record | SQL part functions

select()

This function can set the select columns.

  $user = new User();
  $user->select('id', 'name')->fetch();

from()

This function can set the table to fetch record from.

  $user = new User();
  $user->select('id', 'name')->from('user')->fetch();

join()

This function can set the table to fetch record from.

  $user = new User();
  $user->join('contact', 'contact.user_id = user.id')->fetch();

where()

This function can set where conditions.

  $user = new User();
  $user->where('id=1 AND name="demo"')->fetch();

group()

This function can set the "group by" conditions.

  $user = new User();
  $user->select('count(1) as count')->group('name')->fetchAll();

order()

This function can set the "order by" conditions.

  $user = new User();
  $user->order('name DESC')->fetch();

limit()

This function can set the "limit" conditions.

  $user = new User();
  $user->order('name DESC')->limit(0, 1)->fetch();

Active Record | WHERE conditions

equal()/eq()

  $user = new User();
  $user->eq('id', 1)->fetch();

notEqual()/ne()

  $user = new User();
  $user->ne('id', 1)->fetch();

greaterThan()/gt()

  $user = new User();
  $user->gt('id', 1)->fetch();

lessThan()/lt()

  $user = new User();
  $user->lt('id', 1)->fetch();

greaterThanOrEqual()/ge()/gte()

  $user = new User();
  $user->ge('id', 1)->fetch();

lessThanOrEqual()/le()/lte()

  $user = new User();
  $user->le('id', 1)->fetch();

like()

  $user = new User();
  $user->like('name', 'de')->fetch();

in()

  $user = new User();
  $user->in('id', array(1, 2))->fetch();

notIn()

  $user = new User();
  $user->notin('id', array(1,3))->fetch();

isNull()

  $user = new User();
  $user->isnull('id')->fetch();

isNotNull()/notNull()

  $user = new User();
  $user->isNotNull('id')->fetch();

Active Record | Demo

Include && Init

use voku\db\DB;
use voku\db\ActiveRecord;

require_once 'composer/autoload.php';

$db = DB::getInstance('YOUR_MYSQL_SERVER', 'YOUR_MYSQL_USER', 'YOUR_MYSQL_PW', 'YOUR_DATABASE');
ActiveRecord::setDb($db);

Define Class

namespace demo;

use voku\db\ActiveRecord;

class User extends ActiveRecord {
  public $table = 'user';
  public $primaryKey = 'id';
  
  public $relations = array(
    // format is array($relation_type, $child_namespaced_classname, $foreign_key_of_child)
    'contacts' => array(
      self::HAS_MANY, 
      'Contact', 
      'user_id'
    ),
    // format may be array($relation_type, $child_namespaced_classname, $foreign_key_of_child, $array_of_sql_part_functions)
    'contact' => array(
      self::HAS_ONE, 
      'Contact', 
      'user_id', 
      array(
        'where' => '1', 
        'order' => 
        'id desc')
      ),
  );
}

class Contact extends ActiveRecord{
  public $table = 'contact';
  public $primaryKey = 'id';
  
  public $relations = array(
    // format is array($relation_type, $parent_namespaced_classname, $foreign_key_in_current_table)
    'user' => array(
      self::BELONGS_TO, 
      'User', 
      'user_id'
    ),
  );
}

Init data (for testing - use migrations for this step, please)

ActiveRecord::execute("
  CREATE TABLE IF NOT EXISTS user (
    id INTEGER PRIMARY KEY, 
    name TEXT, 
    password TEXT 
  );"
);

ActiveRecord::execute("
  CREATE TABLE IF NOT EXISTS contact (
    id INTEGER PRIMARY KEY, 
    user_id INTEGER, 
    email TEXT,
    address TEXT
  );"
);

Insert one User into database.

use demo\User;

$user = new User();
$user->name = 'demo';
$user->password = password_hash('demo', PASSWORD_BCRYPT, array("cost"=>15));
$user_id = $user->insert();

var_dump($user_id); // the new id 
var_dump($user->id); // also the new id 
var_dump($user->getPrimaryKey()); // also the new id 

Insert one Contact belongs the current user.

use demo\Contact;

$contact = new Contact();
$contact->address = 'test';
$contact->email = 'test1234456@domain.com';
$contact->user_id = $user->id;

var_dump($contact->insert()); // the new id 
var_dump($contact->id); // also the new id 
var_dump($contact->getPrimaryKey()); // also the new id 

Example to using relations

use demo\User;
use demo\Contact;

$user = new User();

// fetch one user
var_dump($user->notnull('id')->orderby('id desc')->fetch());

echo "\nContact of User # {$user->id}\n";
// get contacts by using relation:
//   'contacts' => array(self::HAS_MANY, 'Contact', 'user_id'),
var_dump($user->contacts);

$contact = new Contact();

// fetch one contact
var_dump($contact->fetch());

// get user by using relation:
//    'user' => array(self::BELONGS_TO, 'User', 'user_id'),
var_dump($contact->user);

Logging and Errors

You can hook into the "DB"-Class, so you can use your personal "Logger"-Class. But you have to cover the methods:

$this->trace(string $text, string $name) { ... }
$this->debug(string $text, string $name) { ... }
$this->info(string $text, string $name) { ... }
$this->warn(string $text, string $name) { ... } 
$this->error(string $text, string $name) { ... }
$this->fatal(string $text, string $name) { ... }

You can also disable the logging of every sql-query, with the "getInstance()"-parameter "logger_level" from "DB"-Class. If you set "logger_level" to something other than "TRACE" or "DEBUG", the "DB"-Class will log only errors anymore.

DB::getInstance(
    getConfig('db', 'hostname'),        // hostname
    getConfig('db', 'username'),        // username
    getConfig('db', 'password'),        // password
    getConfig('db', 'database'),        // database
    getConfig('db', 'port'),            // port
    getConfig('db', 'charset'),         // charset
    true,                               // exit_on_error
    true,                               // echo_on_error
    'cms\Logger',                       // logger_class_name
    getConfig('logger', 'level'),       // logger_level | 'TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'
    getConfig('session', 'db')          // session_to_db
);

Showing the query log: The log comes with the SQL executed, the execution time and the result row count.

  print_r($db->log());

To debug mysql errors, use $db->errors() to fetch all errors (returns false if there are no errors) or $db->lastError() for information about the last error.

  if ($db->errors()) {
    echo $db->lastError();
  }

But the easiest way for debugging is to configure "DB"-Class via "DB::getInstance()" to show errors and exit on error (see the example above). Now you can see SQL-errors in your browser if you are working on "localhost" or you can implement your own "checkForDev()" via a simple function, you don't need to extend the "Debug"-Class. If you will receive error-messages via e-mail, you can implement your own "mailToAdmin()"-function instead of extending the "Debug"-Class.

Changelog

See CHANGELOG.md.

  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Files folder imagetests (9 files, 1 directory)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file circle.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imagevoku (1 directory)

  Files folder image Files  /  src  /  voku  
File Role Description
Files folder imagedb (8 files, 1 directory)

  Files folder image Files  /  src  /  voku  /  db  
File Role Description
Files folder imageexceptions (5 files)
  Plain text file ActiveRecord.php Class Class source
  Plain text file ActiveRecordExpressions.php Class Class source
  Plain text file ActiveRecordExpressionsWrap.php Class Class source
  Plain text file DB.php Class Class source
  Plain text file Debug.php Class Class source
  Plain text file Helper.php Class Class source
  Plain text file Prepare.php Class Class source
  Plain text file Result.php Class Class source

  Files folder image Files  /  src  /  voku  /  db  /  exceptions  
File Role Description
  Plain text file ActiveRecordException.php Class Class source
  Plain text file DBConnectException.php Class Class source
  Plain text file DBGoneAwayException.php Class Class source
  Plain text file FetchingException.php Class Class source
  Plain text file QueryException.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagefixtures (11 files)
  Plain text file ActiveRecordTest.php Class Class source
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script
  Plain text file Foobar.php Class Class source
  Plain text file FoobarContact.php Class Class source
  Plain text file FoobarUser.php Class Class source
  Plain text file SimpleDbTest.php Class Class source
  Plain text file SimpleHelperTest.php Class Class source
  Plain text file SimplePrepareTest.php Class Class source
  Plain text file SimpleResultTest.php Class Class source

  Files folder image Files  /  tests  /  fixtures  
File Role Description
  Accessible without login Image file image.png Data Auxiliary data
  Accessible without login Plain text file iso-8859-7.txt Doc. Documentation
  Accessible without login Plain text file latin.txt Doc. Documentation
  Accessible without login Plain text file sample-html.txt Doc. Documentation
  Accessible without login Plain text file sample-simple-html.txt Doc. Documentation
  Accessible without login Plain text file sample-utf-16-be-bom-only.txt Doc. Documentation
  Accessible without login Plain text file sample-utf-16-le-bom-only.txt Doc. Documentation
  Accessible without login Plain text file sample-utf-8-bom-only.txt Doc. Documentation
  Accessible without login Plain text file sample-utf-8-bom.txt Doc. Documentation
  Accessible without login Plain text file utf-8-bom.txt Doc. Documentation
  Accessible without login Plain text file utf-8.txt Doc. Documentation

Downloadsimple-mysqli-2017-12-15.zip 85KB
Downloadsimple-mysqli-2017-12-15.tar.gz
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Portable UTF-8 Download .zip .tar.gz String-Handling Required
 Version Control Reuses Unique User Downloads Download Rankings  
 100%1
Total:522
This week:32
All time:5,507
This week:12Up
 User Ratings  
 
 All time
Utility:91%StarStarStarStarStar
Consistency:100%StarStarStarStarStarStar
Documentation:91%StarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:64%StarStarStarStar
Rank:820