scalar() public method
Returns the query result as a scalar value.
The value returned will be the specified attribute in the first record of the query results.
public string scalar ( $attribute, $db = null ) | ||
---|---|---|
$attribute | string |
Name of the attribute to select |
$db | yii\redis\Connection |
The database connection used to execute the query. If this parameter is not given, the |
return | string |
The value of the specified attribute in the first record of the query result. Null is returned if the query result is empty. |
Please login to continue.