PHP code example of tlangelani / sybase-database

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

    

tlangelani / sybase-database example snippets



// add Sybase class to your project, you can use composer autoload as well
 NB: DEV_HOST must be configured in your Sybase interfaces file, or freetds conf file.
$sybase = new Sybase('DEV_HOST', 'DEV_DB', 'USER', 'PASS');

// list databases
$dbs = $sybase->getDB();

// list database tables
$tables = $sybase->getTables('live_db');

// list table columns
$columns = $sybase->getTableColumns('users');

// run query
$users = $sybase->query('SELECT * FROM users');

// run query with and return data as object
$users = $sybase->query('SELECT * FROM users', 'OBJ');