I wanted to know if there was a way to work with a result from a fetch class command without using the foreach loop. I'm trying to create a login function that puts the user info into a class.
Is there a way to get get data from a class that holds just one result without loop?
$result = $dbquery->fetchALL(PDO::FETCH_CLASS, "userclass");
echo $result->username;