I'm new to PHP. I've created classes that represent my database tables (I come from a .Net entity framework background). I would like to run my SELECT statement and pass back a User
object. All the examples I've found parse the returned data. Is there a way to just do something like this and have it pass back a User
object:
$user = new user();
$user = $mysqli->query($query, MYSQLI_STORE_RESULT);
return $user;
or do I have to parse the result first?
Note: all the fields in the user class match the fields in the database I.E. $user->UserName = [user].[UserName]