PHP code example of dabl / adapter
1. Go to this page and download the library: Download dabl/adapter 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/ */
dabl / adapter example snippets
use Dabl\Adapter\DABLPDO;
// get connection (parameters usually come from .ini file)
$pdo = DABLPDO::connect(array(
'driver' => 'mysql',
'host' => 'localhost',
'dbname' => 'test',
'user' => 'root',
'password' => ''
));
// Get database schema
$schema = $pdo->getDatabaseSchema();
$tables = $schema->getTables();
$columns = $table[0]->getColumns();
$type = $columns[0]->getType();