Database Abstraction Layer for PHP

User Tools

Site Tools


This is an old revision of the document!


 mixed getRow (
       mixed $sql
       optional string[] $bindvars


The function executes a statement and returns the first row of the recordset in an array or false if the statement execution fails. If no records match the provided SQL statement, an empty array is returned.

The presentation of the returned data can be modified by the variables $ADODB_FETCH_MODE and $ADODB_ASSOC_CASE and the function setFetchMode().

For a detailed description of the SQL and bind parameters passed, see execute().

The statement is not the equivalent of selectLimit($SQL,1). If multiple records are returned by the statement execution, all records after the first are destroyed. Reading large tables with a broad recordset selection may be slow,


 * DB2 Connection assumed
$ar = $db->getRow("SELECT * FROM ACT");
 * $ar returns:
    [0] => 10
    [1] => MANAGE
    [2] => MANAGE/ADVISE
v5/reference/connection/getrow.1452988313.txt.gz · Last modified: 2017/04/21 11:34 (external edit)