Function Reference / get_var – ezSQL

get_var a method of ezSql class, is used to retrieve a single variable from database.

Description

get_var is used to retrieve a single variable from database. Though it returns only single variable but whole query is saved in cache and can be accessed through “last_result” function.
This function returns ‘NULL’ if no result is found.

Format

 

Parameters

$query (required)

(string) The query you wish to run. Setting this parameter to NULL will return cached variable from last query.

$col_offset (optional)

(integer) The desired columns. First is 0, defaults to 0

$row_offset (optional)

(integer) The desired row. First row is 0, defaults to 0.

Usage

 

Returns

Single value on success, NULL if no result is found.