PHP code example of sad_spirit / pg_wrapper

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

    

sad_spirit / pg_wrapper example snippets


var_dump(pg_fetch_assoc(pg_query($conn, 'select * from test')));

$result = $connection->execute('select * from test');
var_dump($result[0]);

$factory      = new DefaultTypeConverterFactory();
$arrayLiteral = $factory->getConverterForTypeSpecification('INTEGER[]')->output([1, 2, 3]);