db\Query scalar()

scalar() public method

Returns the query result as a scalar value.

The value returned will be the first column in the first row of the query results.

public string|null|false scalar ( $db = null )
$db yii\db\Connection

The database connection used to generate the SQL statement. If this parameter is not given, the db application component will be used.

return string|null|false

The value of the first column in the first row of the query result. False is returned if the query result is empty.

doc_Yii
2016-10-30 16:59:04
Comments
Leave a Comment

Please login to continue.