PHP code example of juanensuncho / db-factory

1. Go to this page and download the library: Download juanensuncho/db-factory 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/ */

    

juanensuncho / db-factory example snippets


   use DBfactory\DbPostgresFactory;

   $config = [
       'BASE' => 'nombre_base_datos',
       'HOST' => 'localhost',
       'USER' => 'usuario',
       'PASS' => 'contraseña',
       'PORT' => 5432 // Opcional
   ];

   $db = DbPostgresFactory::create($config);

   // Realizar consultas utilizando Medoo
   $data = $db->select('usuarios', '*');
   
bash
db-factory/
├── docs/
│   ├── CONFIGURACION_ENV.md
│   └── DOCUMENTACION_FRAMEWORK.md
├── examples/
│   ├── README.md
│   ├── mysql_example.php
│   ├── postgres_example.php
│   ├── oracle_example.php
│   └── multiple_connections.php
├── src/
│   ├── DbMysqlFactory.php
│   ├── DbOracleFactory.php
│   └── DbPostgresFactory.php
├── composer.json
├── LICENSE
└── README.md