PHP code example of pointybeard / symphony-pdo

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

    

pointybeard / symphony-pdo example snippets



use SymphonyPDO;

$query = SymphonyPDO\Loader::instance()->query(
    'SELECT * FROM `tbl_sections` ORDER BY `id` ASC;'
);

var_dump($query->fetchObject()->name);
// string(8) "Articles"

// Or, better yet, use a ResultIterator instead
foreach(new SymphonyPDO\Lib\ResultIterator('\stdClass', $query) as $result) {
    printf('%d => %s (%s)' . PHP_EOL, $result->id, $result->name, $result->handle);
}
// 1 => Articles (articles)
// 2 => Categorties (categories)