redis\ActiveQuery scalar()

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 db application component will be used.

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.

doc_Yii
2016-10-30 17:10:39
Comments
Leave a Comment

Please login to continue.