decaldaswcl/php_database-manager

Set of SQL language commands that are used to retrieve, add, remove and modify information within a database

dev-master 2022-07-28 21:27 UTC

This package is auto-updated.

Last update: 2025-07-29 02:47:30 UTC


README

PHP_Database-Manager Set of SQL language commands that are used to retrieve, add, remove and modify information within a database.

Requeriments

PHP_Database-Manager requires PHP version 7.3 or greater.

Installation

Composer

If you use Composer, you can install PHP_DatabaseManager system-wide with the following command:

composer global require "decaldaswcl/PHP_database-manager"

Or alternatively, include a dependency for decaldaswcl/PHP_database-manager in your composer.json file. For example:

{
    "require-dev": {
        "decaldaswcl/PHP_database-manager": "1.0.*"
    }
}

Getting Started

How to include the class in your project

<?php

require 'vendor/autoload.php';

use decaldaswcl\DatabaseManager\Database;

Configuring the class and instantiating

Database::config('LocalHost','dataBase','user','pass','port');

$object = new Database('tableName');

Using the functions

  • Select responsible for executing a query in the database

return object of type PDOStatement

$results = $obDatabase->select('id < 5 ');
  • Insert responsible for inserting data into the database

return inserted id

$id = $obDatabase->insert([
  'name' => 'Isac'
]);
  • Update responsible for performing updates on the database

return a boolean value

$boolean = $obDatabase->update('id = 1',[
  'age' => '30'
]);
  • Delete responsible for deleting database data

return a boolean value

$success = $obDatabase->delete('id = 1');