Perform a query on the database and return the first result row as object
It adds the LIMIT 1
clause if the query has no record limit
This is useful for one-row fetching. No need explicit db_query()
call as this invokes it internally.
Parameters | |||
---|---|---|---|
string
|
$sql |
The SQL query string |
# |
array
|
$args = [] |
The array of placeholders and their values |
# |
Returns | |
---|---|
object
|
The result object |