1. Go to this page and download the library: Download sandro/php-database-manager library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sandro / php-database-manager example snippets
androAmancio\DatabaseManager\Database;
//DATABASE CREDENTIALS
$dbHost = 'localhost';
$dbName = 'database';
$dbUser = 'root';
$dbPass = 'pass';
$dbPort = 3306;
//Configuração da classe de banco de dados
DataBase::config($dbHost,$dbName,$dbUser,$dbPass,$dbPort);
//Instancinado um tabela
$obDatabase = new Database('table_name');
//SELECT (return a PDOStatement object)
$results = $obDatabase->select('id > 10','name ASC','1','*');
//INSERT (return inserted id)
$id = $obDatabase->insert([
'name' => 'Meu Nome'
]);
//UPDATE (return a bool)
$success = $obDatabase->update('id = 1',[
'name' => 'meu nome2'
]);
//DELETE (return a bool)
$success = $obDatabase->delete('id = 1');
Shell
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.