Get a result using key, value. Returns Number of rows located (usually 1) for success, and puts all the table columns into this classes variables. If only one parameter is used, it is assumed that first parameter is a value and get() will use the primary key.
Table 26-1. Possible PEAR_Error values
| Error code | Error message | Meaning | Solution |
|---|---|---|---|
| DB_DATAOBJECT_ERROR_INVALIDCONFIG | "No Keys available for $table" | ||
| DB_DATAOBJECT_ERROR_INVALIDARGS | "No Value specified for get" |
This function can not be called statically.
You should avoid calling get on the same object instance twice, as this will result in unexpected results.
Example 26-1. Simple fetch of data based on Primary Key
|
Example 26-2. Resulting SQL
|
Example 26-3. Simple fetch of data based on Key and Value
|
Example 26-4. Resulting SQL
|
Example 26-5. Results of example code
|