Interface SelectQueryResultInterface

Description

The SelectQueryResult interface provides the functionality common to a SELECT query result.

The SelectQueryResult interface provides the functionality common to a SELECT query result. For example, you can fetch associative arrays, advance the current row position, etc.

  • copyright: 2003
  • access: public
  • version: $Id: SelectQueryResult.interface.php,v 1.8 2007/09/05 21:38:59 adamfranco Exp $

Located in /harmoni/core/DBHandler/SelectQueryResult.interface.php (line 44)

QueryResultInterface
   |
   --SelectQueryResultInterface
Method Summary
boolean advanceRow ()
void bindField (string $field, ref $var)
mixed field (mixed $field)
void free ()
array getCurrentRow ([optional $arrayType = BOTH])
array getFieldNames ()
integer getNumberOfFields ()
integer getResourceId ()
boolean hasMoreRows ()
boolean hasNext ()
boolean moveToRow (integer $rowNumber)
array next (optional 0)
void unbindField (string $field)
Methods
advanceRow (line 84)

Advances the current row position.

Advances the current row position. If there are no more rows left, then it returns

  1. false
.

  • return: True, if successful; False, otherwise.
  • access: public
boolean advanceRow ()
bindField (line 162)

Binds the field specified by the first argument to the variable given as

the second argument. The method stores a reference to the variable represented by the second argument; whenever a new row is fetched, the value of the field in the new row will be updated in the referenced variable. This enables the user to avoid unnecessary calls to

  1. getCurrentRow()
or
  1. field()
.

  • access: public
void bindField (string $field, ref $var)
  • string $field: field The field to bind. This could be either a string value that would correspond to the field as returned by
    1. getFieldNames()
    , or an integer (less than
    1. getNumberOfFields()
    ) corresponding to the index of the field.
  • ref $var: mixed var The variable to be bound to the value of the field in the current row.
field (line 104)

Returns the specified field value in the current row.

Returns the specified field value in the current row.

  • return: The value that was requested.
  • access: public
mixed field (mixed $field)
  • mixed $field: The name or index of the field, whose value will be returned.
free (line 179)

Frees the memory for this result.

  • access: public
void free ()
getCurrentRow (line 133)

Returns an array that stores the current row in the result. The data can be accessed through associative indices as well as numeric indices.

  • return: An associative array of the current row.
  • access: public
array getCurrentRow ([optional $arrayType = BOTH])
  • optional $arrayType: integer arrayType Specifies what type of an array to return. Allowed values are: ASSOC, NUMERIC, and BOTH.
getFieldNames (line 122)

Returns an indexed array of all field names that were selected.

Returns an indexed array of all field names that were selected.

  • return: An array of all field names that were selected.
  • access: public
array getFieldNames ()
getNumberOfFields (line 113)

Get the number of fields that were selected by the SELECT query.

Get the number of fields that were selected by the SELECT query.

  • return: The number of fields.
  • access: public
integer getNumberOfFields ()
getResourceId (line 55)

Returns the resource id for this SELECT query.

Returns the resource id for this SELECT query. The resource id is returned by the mysql_query() function.

  • return: The resource id for this SELECT query.
  • access: public
integer getResourceId ()
hasMoreRows (line 94)

Indicates if there are any remaining rows returned by the SELECT query.

Indicates if there are any remaining rows returned by the SELECT query including the current row.

  • return: True, if there are some rows left; False, otherwise.
  • access: public
boolean hasMoreRows ()
hasNext (line 64)

Indicates if there are any remaining rows returned by the SELECT query.

Indicates if there are any remaining rows returned by the SELECT query including the current row.

  • return: True, if there are some rows left; False, otherwise.
  • access: public
boolean hasNext ()
moveToRow (line 144)

Moves the internal row pointer to the specified position. The range of possible values is

  1. 0 - (getNumberOfRows()-1)
.

  • return:
    1. true
    , if operation was successful;
    1. false
    , otherwise.
  • access: public
boolean moveToRow (integer $rowNumber)
  • integer $rowNumber: rowNumber The number of the row to move to.
next (line 75)

Returns an array that stores the current row in the result and advances to the next row. The data can be accessed through associative indices as well as numeric indices.

  • return: An associative array of the current row.
  • access: public
array next (optional 0)
  • optional 0: integer arrayType Specifies what type of an array to return. Allowed values are: ASSOC, NUMERIC, and BOTH.
unbindField (line 172)

Unbinds the field that has been bound by

  1. bindField()
.

  • access: public
void unbindField (string $field)
  • string $field: field The field to unbind. This could be either a string value that would correspond to the field as returned by
    1. getFieldNames()
    , or an integer (less than
    1. getNumberOfFields()
    ) corresponding to the index of the field.

Inherited Methods

Inherited From QueryResultInterface

QueryResultInterface::getNumberOfRows()

Documentation generated on Wed, 19 Sep 2007 10:26:23 -0400 by phpDocumentor 1.3.0RC3