PHP code example of datadistillr / drill-sdk-php

1. Go to this page and download the library: Download datadistillr/drill-sdk-php 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/ */

    

datadistillr / drill-sdk-php example snippets


$drillHandle = new DrillConnection( 'localhost', 8047 );

if( $drillHandle->is_active() ) {
    print( "Connection Active" );
} else {
    print( "Connection Inactive" );
}

$query_result = $drillHandle->query( "SELECT * FROM cp.`employee.json` LIMIT 20" );
while( $row = $query_result->fetch_assoc() ) {
    print( "Field 1: {$row['field1']}\n" );
    print( "Field 2: {$row['field2']}\n" );
}

composer