PHP code example of dbmaker / laravel-odbc

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

    

dbmaker / laravel-odbc example snippets


'dbmaker' => [
    'driver' => 'odbc',
    'dsn' => 'odbc:DSN=DBNAME',
    'database' => 'DBNAME',
    'host' => 'localhost',
    'username' => 'username',
    'password' => 'password',
    'options' => [
            'idcap' => 1   //please set the value same as your server db_idcap
    ]
]

'default' =>  'dbmaker',

# wget https://github.com/dbmaker-go/php_ext/releases/download/1.0.0/php_dbmaker-5.4-7.3-Linux2_x86_64.tgz
# tar zxvf php_dbmaker-5.4-7.3-Linux2_x86_64.tgz
# mv php_dbmaker/bundle/pdo_odbc.ini /etc/php.d/20-pdo-odbc.ini
# mv php_dbmaker/bundle/pdo_odbc.so /usr/lib64/php/modules/pdo-odbc.so
# php -m

# php artisan make:command MyCommand

# vi app/Console/Commands/MyCommand.php

public function handle()
{
    $data= \DB::table('TA1')->get('C1');
	print_R($data);
}

# vi app/Console/Kernel.php