Perform a query on the database and return the first field value only.
It adds the LIMIT 1
clause if the query has no record limit
This will be useful for COUNT()
, MAX()
, MIN()
queries
Parameters | |||
---|---|---|---|
string
|
$sql |
The SQL query string |
# |
array
|
$args = [] |
The array of placeholders and their values |
# |
Returns | |
---|---|
mixed
|
The value of the first field |