PHP code example of dbt / odbc-driver

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

    

dbt / odbc-driver example snippets


'my-odbc-connection' => [
    'driver'   => 'odbc',
    'dsn'      => env('ODBC_DSN'),
    'host'     => env('ODBC_HOST'),
    'database' => env('ODBC_DB'),
    'username' => env('ODBC_USERNAME'),
    'password' => env('ODBC_PASSWORD'),
],

'my-odbc-connection' => [
    ...,
    'grammar' => [
        'query' => Illuminate\Database\Query\Grammars\SqlServerGrammar::class,
        'schema' => Illuminate\Database\Schema\Grammars\SqlServerGrammar::class,
    ],
],

'dsn' => 'odbc:\\\\path\to\my\database',

'dsn' => 'odbc:\\\\my-connection-name',

'dsn' => 'odbc:dbname',

'dsn' => 'sqlsrv:Driver=ODBC Driver 18 for SQL Server;Server=tcp:localhost,1433;TrustServerCertificate=1;Encrypt=1;'
'username' => 'sa',
'password' => 'my-super-secret-password',