selectObject

This is simplified version of select query

This will return only first result as object

mysql::selectObject('users', '*', ['id' => 123456789]);
/** is same as */
mysql::select('users', '*', ['id' => 123456789], 1)->fetch_object();
Arguments
Name Type Description Required
table string Table name yes
columns array Your wanted columns, can be string for single column, array for multi column and '*' for all columns yes
where array | null Your conditions, Set as key => value pair, see examples no
group_by int Your group by, Set as indexed array, value orders is important! no
order_by int Your order by , Set as key => mode pair, mode can be asc or desc no

Output : object | bool | null

Static or normal : Static

Examples :

/** Select all user data */
mysql::selectObject('users', '*', ['id' => 123456789]);
/** Select user step and value data */
mysql::selectObject('users', ['step', 'value'], ['id' => 123456789]);
/** Select top user based on coin value */
mysql::selectObject('users', ['id', 'coin'], order_by: ['coin' => 'desc']);