PHP Function to validate setting

That code can be abbreviated to

return $stmt->rowCount() == 1;

There is never any reason for having an if statement to return true or false - simply return the condition.

2 Likes