Skip to main content
Version: Fegg 5.x (next)

Pdo::id

Get the specific column's list of executed select query

Description​

public array Pdo::id( string $index )

Returns the values of one column of every row of the last SELECT, as a list.

Arguments​

NameData typeDefaultRemarks
$indexstringColumn name

Example​

Controller
$db = new \Fegg\Database\Pdo();

$titles = $db->setItem('title')->select('cms_news')->execute()->id('title');
// -> array('A', 'B', 'C')