$query = "SELECT email FROM users LIMIT 1"; $result = $db->fetch_first($query); $email = $result['email'];
$query = "SELECT MAX(salary) AS max_salary FROM employees"; $result = $db->fetch_first($query); $max_salary = $result['max_salary'];Package library: Laravel's Eloquent ORM In both examples, the fetch_first function is used to retrieve only the first row of the query result set, which contains the data needed. The function returns an associative array which can be accessed using the keys. The package library used may vary, depending on the specific PHP framework or database library being used in the project.