PEAR::DB replacement class

Contents

The getRow() method

This function returns the first row of the result set. You can, if you wish, specify the fetchmode as well as the sql. This will override the default fetchmode. For example:

<?php
    $row = $db->getRow("SELECT * FROM users WHERE id = 5");
?>

or:

<?php
    $row = $db->getRow("SELECT * FROM users WHERE id = 5", DB_FETCHMODE_ASSOC);
?>