$sql = 'SELECT * FROM user WHERE id = 123';
$user = $GLOBALS['dbi']->fetchSingleRow($sql);
produces
$user = array('id' => 123, 'name' => 'John Doe')
public fetchSingleRow ( string $query, string $type = 'ASSOC', object $link = null ) : array | boolean | ||
$query | string | The query to execute |
$type | string | NUM|ASSOC|BOTH returned array should either numeric associative or both |
$link | object | mysql link |
return | array | boolean | first row from result or false if result is empty |