The PDOStatement::fetch()
method returns false
if there are no more rows in the result set.
To overcome this error message, provide an empty array as a default value in case no rows were found.
return $statement->fetch(PDO::FETCH_ASSOC) ?: [];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…