Is there a reason it can't be a permenant solution rather than just a stop gap?
Well, suppose the query failed for some reason* (e.g., could not connect to the database server, could not select the database, query incorrect), an exception would be thrown. At the moment your code presumably would not handle the exception, so the script would just die rather ungracefully.
You could turn it into a more permanent solutipn by handling the exception gracefully (e.g., instead of terminating the script immediately, print a friendly error message, then continue loading the rest of the page that is still relevant). There are other possibilities, e.g., the database wrapper that you are using could throw an exception instead (assuming that it is a custom made wrapper class (or library of classes)).
- Note that returning zero rows in the result set is not a failure. If the user id supplied does not exist in the users table, you might have an array out of bounds error when assigning $res[0] to $this->name and $res[1] to $this->email.