PEAR::DB replacement class

Contents

The getCol() method

This method returns the specified (usually the first) column of a result set. For example:

<?php
    $users = $db->getCol("SELECT username FROM users");
?>

Or:

<?php
    $users = $db->getCol("SELECT username, password FROM users", 1);
?>

This will fetch the second column of the result set (columns are numbered starting with zero).