I have public function user_data()
I need to return username, avatar and level so it would be:
$username = $main->user_data($user, "username")); $avatar = $main->user_data($user, "avatar")); $avatar = $main->user_data($user, "level"));
or i could use query without function:
$stmt = $main->con->prepare('SELECT username, avatar, level FROM users WHERE id=?'); $stmt->execute([$user]); $row = $stmt->fetch();
The question is do i lose time when i select data via function?
I believe that i connect 3 times more if i use function so it is slower?