Method Reference / get_row – ezSQL

get_row is a method of ezSql Class and it can be used to retrieve data of a single row from database. This function returns result in one of three formats which can be Object, Associative or Numerically indexed array.

function get_row

Description

Use get_row to retrieve a single row from database. If there is more than one row returned by query still this function returns only one row which will be either first row or any row specified through $row_offset variable. This function can return row as an object, an associative array, or as a numerically indexed array.

get_row returns NULL, if no result is found.

Format

 

Parameters

$query (required)

(string) The query you wish to run. Setting this parameter to NULL will return row data from cached result of last executed query.

$output_type (optional)

(pre-defined) One of the three pre defined constants. Defaults to ‘OBJECT’

  • OBJECT – result will be output as an object.
  • ARRAY_A – result will be output as an associative array.
  • ARRAY_N – result will be output as a numerically indexed array.

$row_offset (optional)

(integer) The desired row ( first row is 0). Defaults to 0.

Usage

 

 

Returns

get_row returns row data returned in format as set through $output_type variable.
If no result is found this function returns NULL.

  • Pingback: Maria Smith()