PHP code example of qwant50 / dbconnect

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

    

qwant50 / dbconnect example snippets


$db = DbConnect::getInstance(['connectionName' => 'db1',
                              'host' => '127.0.0.1',
                              'dbname' => 'test',
                              'username' => 'webuser',
                              'password' => 'xxxxxxxx',]);

$db = DbConnect::getInstance(['connectionName' => 'db1',
                              'host' => '127.0.0.1',
                              'dbname' => 'test',
                              'username' => 'webuser',
                              'password' => 'xxxxxxxx',])->getConnection();

$db = DbConnect::getInstance(['connectionName' => 'db1',
                              'host' => '127.0.0.1',
                              'dbname' => 'test',
                              'username' => 'webuser',
                              'password' => 'xxxxxxxx',])->getConnection();
$stmt = $db->prepare("SELECT * FROM table_name WHERE login = :login");
$stmt->bindParam(':login', $login);
$stmt->execute();
sh
php composer.phar