Pike v8.1 release 6

Method Mysql.SqlTable()->get_multi()


Method get_multi

Result get_multi(array(mixed) ids, void|array(string) fields)

Description

Retrieves multiple records selected by primary key values.

This function currently only works if the primary key is a single column.

Parameter id

Array containing primary key values.

The number of returned records might be less than the number of entries here if some of them don't match any record. Also, the order of the returned records has no correlation to the order in the id array.

Parameter fields

The fields to retrieve. All fields are retrieved if it's zero or left out.

For columns, the result mappings always have corresponding entries. Other fields, i.e. properties, only occur in the result mappings when they match fields in the prop_col column.

A 0 (zero) entry can be used in fields to return all properties without filtering.

Returns

Returns a SqlTable.Result object from which the results can be retrieved. Zero is never returned.

Note

The result object implements an iterator, so it can be used directly in e.g. a foreach.

See also

get, select, select1